I have one table (call it abc
) like below:
The column named 'likelihood'is a JSON Object (key-value).
I have another table (lets call it xyz
) that contains CustomerId and key(an integer value) columns.
I am joining the two tables above based on customerid like:
Select xyz.customerid, key, label from xyz join abc on xyz.customerid = abc.customerid
Question:
I want to find label
against the key provided in the key
column of table xyz
, from the JSON Object of the column likelihood
in the table abc
.
All the examples of function JSON_EXTRACT
that I have found, are passing hard coded key instead of some dynamic value of key taken from the database.