假设我们有这样的查询:
SELECT
1
FROM DUAL WHERE
(SELECT id FROM table_1 t1 WHERE /*conditions*/)
IN
(SELECT id FROM table_1 t2 WHERE /*conditions*/)
我想检查第一个查询是否SELECT id FROM table_1 t1 WHERE /*conditions*/
返回与第二个查询相同的ID。当然,此查询(IN
语句)不起作用。
如果集合相等,将不返回任何内容:
SELECT id FROM table_1 t1 WHERE /*conditions*/
EXCEPT
SELECT id FROM table_1 t2 WHERE /*conditions*/
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句