Hey
I am trying to read JSON data into SQL.
With a "flat" JSON file,no problem.
SELECT * FROM OPENJSON(@json) WITH(id as int)
But I got a nested JSON file, that is structured this way:
id
- stats
--stat1
--stat2
--stat3
id
-stats
--stat1
--stat2
--stat3
How can I write an SQL, that will output that data in one row? Like this:
id,stat1,stat2,stat3
id,stat1,stat2,stat3
Any help out here?
Thanks you brilliant guys:)