子查询写法:
select * from a where id,type in ( select id,type from b);
子查询方式的代替方式
select * from b where exists ( select * from a where a.id=b.id and a.type=b.type);
穷举写法:
select * from a where id,type in ((1,2),(,2,2));
子查询写法:
select * from a where id,type in ( select id,type from b);
子查询方式的代替方式
select * from b where exists ( select * from a where a.id=b.id and a.type=b.type);
穷举写法:
select * from a where id,type in ((1,2),(,2,2));
本文标题:2019-04-29 SQL 多列IN匹配
本文链接:https://www.haomeiwen.com/subject/ulhpnqtx.html
网友评论