T-SQL JSON Join using varchar field

Carlos Barini 21 Reputation points
2021-06-24T13:28:33.81+00:00

109023-image.png

I need to return three lines:
1- meat / carne
2- meat / boi
3- meat / boi gordo

How can I do that?

Developer technologies | Transact-SQL
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
{count} votes

Answer accepted by question author
  1. Viorel 125.8K Reputation points
    2021-06-24T13:59:18.257+00:00

    Try this query:

    select word, [synonym]
    from adlWordBags
    cross apply OPENJSON(JSONSynonyms) with ( [synonym] nvarchar(max) '$.word' )
    where JSONSynonyms <> ''
    
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.