- --union 有排序效果、並且合併既有數據
- SELECT 'b' AS col
- UNION
- SELECT 'a' AS ccc
- UNION
- SELECT 'b' AS RESULT
- --union all 無排序效果
- SELECT 'b' AS col
- UNION ALL
- SELECT 'a' AS ccc
- UNION ALL
- SELECT 'b' AS RESULT
- --intersect 交集
- --except 差集
- SELECT N
- FROM a
- INTERSECT
- SELECT N
- FROM b
沒有留言:
張貼留言