| JsonData |
|---|
| {"DestinationLists" : [{"name" : "Slingshot", "destinations" : [{"Id" : 4155}, {"Id" : 191}, {"Id" : 165}, {"Id" : 183}]}]} |
| {"DestinationLists" : [{"name" : "TVNZ, Mediaworks, Choice", "destinations" : [{"Id" : null}]}, {"name" : "TVNZ, Discovery", "destinations" : [{"Id" : 165}, {"Id" : 183}, {"Id" : 4155}]}]} |
| {"DestinationLists" : [{"name" : "SecondTest", "destinations" : [{"Id" : 103}, {"Id" : 105}]}, {"name" : "ThirdTest", "destinations" : [{"Id" : 3}, {"Id" : 5}]}]} |
I am trying to write a select query on this data which empties the destinations array incase any of the "Id" is null
So the output should be (empty destinations array in second row) :-
| JsonData |
|---|
| {"DestinationLists" : [{"name" : "Slingshot", "destinations" : [{"Id" : 4155}, {"Id" : 191}, {"Id" : 165}, {"Id" : 183}]}]} |
| {"DestinationLists" : [{"name" : "TVNZ, Mediaworks, Choice", "destinations" : []}, {"name" : "TVNZ, Discovery", "destinations" : [{"Id" : 165}, {"Id" : 183}, {"Id" : 4155}]}]} |
| {"DestinationLists" : [{"name" : "SecondTest", "destinations" : [{"Id" : 103}, {"Id" : 105}]}, {"name" : "ThirdTest", "destinations" : [{"Id" : 3}, {"Id" : 5}]}]} |
How can I achieve this?