PostgreSQL 8.2.3 婺桺桺懼
劯锔媆锔䆹7. 昖臵媆誕嬉誕

7.4. 䂇劽昖臵

埇傖凹婴婻昖臵䔇䂷悩誕臯镖劽淉嘩(幽㔕庴㔕噞)㔗臺濘滇

query1 UNION [ALL] query2
query1 INTERSECT [ALL] query2
query1 EXCEPT [ALL] query2

query1query2 埇傖滇螘螺誺䔇欔橬昖臵㔗镖劽淉嘩幘埇傖啯喖启亓誂懫套

query1 UNION query2 UNION query3

垄垂鍙婪京備庯

(query1 UNION query2) UNION query3

UNIONquery2 䔇䂷悩鍇媹彄 query1 䔇䂷悩婪(婉誺潏傸婉脘媺臕認儌滇認底臯垂鍙䔇誫啂釺废)幽婫償 DISTINCT 闼湙役鍴䂷悩婺欔橬麉崉䔇臯(鍴麂弄滯庖 UNION ALL)㔗

INTERSECT 誫啂闼底劯施庻婘庯 query1query2 䂷悩婺䔇臯鍴麂弄滯庖 INTERSECT ALL 劥彍欔橬麉崉臯鄘赆役鍴㔗

EXCEPT 誫啂欔橬婘 query1 䂷悩婺嘖滇婉婘 query2 䂷悩婺䔇臯(橬施冇認埆啔婴婻昖臵䔇)㔗鍴麂弄滯庖 EXCEPT ALL 劥彍欔橬麉崉臯鄘赆役鍴㔗

婺庖脘崘螇䞖婴婻昖臵䔇幽㔕庴㔕噞認婴婻昖臵媙釂滇"幽镖噚垹䔇"幘儌滇垄傸鄘誫啂劯湙昄麟䔇彖幽婫凹庫䔇彖橬噚垹䔇昄扞䌂傋儌償誗10.5麯柟誄䔇闼湙㔗


劯锔饡釕嬉誕
锬拷彖臘婪婔亓臯毐废