Q: At present, I have the ID of table_b
. How can I query the data corresponding to table_a
?
table_a
id | value |
---|---|
1 | a1 |
2 | a2 |
3 | a3 |
table_b
id | table_a_ids |
---|---|
1 | [1, 2] |
2 | [2, 3] |
It’s not effective
select * from table_a where id in (select json_extract(batch_bill_ids, '$') from table_b where id = 1);
2
Answers
Test this:
You may do a join using the member of operator as the following:
demo