Existing tables table1 and table2, table structure table1: table2: The purpose is to query from table1 that all stus are 0, and all records corresponding to fid contained in the fids field of table 2. The SQL statement is as follows: select * fromtable1whereexists (selectfidfromtable2wherestus0
Existing tables table1 and table2, table structure table1: table2: The purpose is to query from table1 that all stus are 0, and all records corresponding to fid contained in the fids field of table 2. The SQL statement is as follows: select * from table1 where exists (select fid from table2 where stus = '0'
Existing tables table1 and table2, Table Structure
Table1: table2:
The purpose is to query all records whose stus value is 0 and whose fid value is included in the value of the fids field of table 2.
The SQL statement is as follows:
Select * from table1
Where exists (
Select fid from table2
Where stus = '0'
And table2.fids like '%' | table1.fid | '% ')
The query result is as follows: