A表 order_id data
1 1
2 2
3 3
B表 order_id state
1 1
2 2
查找A中与B不重复的对应order_id的data(即order_id=3的data),sql语句怎么写?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
select data
from A left join B on A.order_id = B.order_id
where isnull(B.state)
select data from A where A.id not IN (select B.id from B)