I am trying to join data between two tables. But the data is stored using what appears to be JSON array data. Here is an example:
ID name types
45 Four O'Clock {"1":"9","2":"10"}
46 Globe Amaranth ["8","9"]
The second complication is the data is stored in two ways. With brackets and with braces. When it uses braces the first item in the key:value is the order and not relevant to my needs. I only need the second item which is the ID in the related table.
Is there anyway to elegantly perform a join with this data structure in SQL?
Thanks, -Matt