If you’re trying to extract values from a JSON document, but one or more of the values on the same level have duplicate keys, you might run into problems if you try to extract those values using JSON_QUERY()
or JSON_VALUE()
.
Both of those functions will only return the first value that matches the path.
Fortunately, there’s another option.
The OPENJSON()
function will return all values from any duplicate keys on the same level.