-- 报错代码 select top 3 * from emp where empno not in (select top 3 * from emp order by sal desc) order by sal desc
错误原因:如果要用in,后面 SELECT 必须能只能由一个列组成
-- 更正 select top 3 * from emp where empno not in (select top 3 empno from emp order by sal desc) order by sal desc;
如果是多列
select * from A where exists( select b from tab where A.b = tab.B and A.b2 = tab.B2)
标签: #原因
评论列表