JSON input looks like this:
{
"reporting.unit": [ "F-1", "F-2", "F-3"],
"notional.lc": [ 100.1, 140.2, 150.3]
}
Desired Output:
reporting.unit | notional.lc |
---|---|
F-1 | 100.1 |
F-2 | 140.2 |
F-3 | 150.3 |
Note I have upwards of 20 columns and many more elements
I tried:
DECLARE @json nvarchar(max);
SELECT @json = '{
"reporting.unit": [ "F-1", "F-2", "F-3"],
"notional.lc": [ 100.1, 140.2, 150.3]
}';
SELECT *
FROM OPENJSON (@json);
but the result was:
key | value | type |
---|---|---|
reporting.unit | [ "F-1", "F-2", "F-3"] | 4 |
notional.lc | [ 100.1, 140.2, 150.3] | 4 |