请教sql语句 mysql数据库

2025-02-25 12:05:49
推荐回答(4个)
回答1:

select * from a where a.pro_id not in(select pla_id from b )

回答2:

1、select * from a where pro_id not in (select pla_id from b)
2、select * from a where not exists(select 1 from b where b.pla_id=a.pro_id)
3、select t1.* from a left join b on a.pro_id=b.pla_id where b.pla_id is null

回答3:

select * from a where pro_id=5 or pro_id=6

回答4:

select * from a where pro_id in (5,6);