SQL Rookie here, I am trying to take a JSON argument into a stored procedure which is a JSON array [123, 124, 125]
and convert the items to be used in an IN
expression. I know there is JSON_EXTRACT
function in SQL but not too familiar with it. This is MySql.
2
Answers
You can use
json_table
in a subquery within
:See fiddle
It’s not good idea to use
JSON_TABLE
, you should useMEMBER OF
statement.JSON_TABLE creates temporary table and then you are querying all over that table to use IN statement. Instead u can use MEMBER OF which is not creating table, instead searches inside json array