union和union all 的區別

Union和Union all 的區別     在數據庫中,union和union all關鍵字都是將兩個結果集合併爲一個,但這兩者從使用和效率上來說都有所不同。 union在進行錶鏈接後會篩選掉重複的記錄,所以在錶鏈接後會對所產生的結果集進行排序運算,刪除重複的記錄再返回結果。 如: select * from test_union1    union select * from test_un
相關文章
相關標籤/搜索