I have a row:
id, shipping_data, line_data
0, '[{"name": "Greg", "Address": "test address"}]', '[{"products": "apple", "cost": "0.50"'}'
and I want to expand the row to display all data in one row.
I tried using multiple cross applies:
SELECT id, A.*, B.*
FROM table t
CROSS APPLY OPENJSON(t.[shipping_data])
WITH (
name nvarchar(max),
Address nvarchar(max)
) A;
CROSS APPLY OPENJSON(t.[line_data])
WITH (
products nvarchar(max),
cost nvarchar(max)
) B;