Forum Discussion

ChaitanyaMhatre's avatar
ChaitanyaMhatre
Copper Contributor
Jan 25, 2024

want to fetch the records that contains at least one value from the array in ID column.

want to fetch the records that contains at least one value from the array in ID column.
while the array contains the keys of the JSON document stored in same table and the column name as Following set as JSON datatype

SELECT * FROM user WHERE CAST(ID AS CHAR) IN (SELECT JSON_KEYS(Following) FROM user WHERE ID = 1);
  • olafhelper's avatar
    olafhelper
    Bronze Contributor
    That's really to less on information.
    Please post table design as DDL, some sample data as DML statement and the expected result.

Resources