当前位置: 代码迷 >> 综合 >> MINUS(差集)、INTERSECT(交集)和UNION (ALL)(并集)
  详细解决方案

MINUS(差集)、INTERSECT(交集)和UNION (ALL)(并集)

热度:66   发布时间:2023-12-13 02:11:28.0

MINUS(差集)

代码:

WITH A AS (
SELECT '1' AS num FROM dual UNION
SELECT '2' AS num FROM dual UNION
SELECT '3' AS num FROM dual UNION
SELECT '4' AS num FROM dual UNION
SELECT '5' AS num FROM dual UNION
SELECT '6' AS num FROM dual UNION
SELECT '7' AS num FROM dual UNION
SELECT '8' AS num FROM dual UNION
SELECT '9' AS num FROM dual ), B AS (
SELECT '6' AS num FROM dual UNION
SELECT '7' AS num FROM dual UNION
SELECT '8' AS num FROM dual UNION
SELECT '9' AS num FROM dual UNION
SELECT '10' AS num FROM dual UNION
SELECT '11' AS num FROM dual UNION
SELECT '12' AS num FROM dual UNION
SELECT '13' AS num FROM dual UNION
SELECT '14' AS num FROM dual UNION
SELECT '15' AS num FROM dual
  相关解决方案