union與union allunion 缺省在合并結(jié)果集后消除重復(fù)項,union all 指定在合并結(jié)果集后保留重復(fù)項, 打個比喻吧 比如A表的數(shù)據(jù)是 A{ 1,4,5,9} B{2,3,4,5}那我執(zhí)行此語句 select * from A union select * from B 那結(jié)果是{1,2,3,4,5,9}如果執(zhí)行select * from A union all select * from B 結(jié)果是{1,2,3,4,4,5,5,9}
新聞熱點
疑難解答
圖片精選