最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

SQLServer 數(shù)據(jù)集合的交、并、差集運(yùn)算

 更新時(shí)間:2009年09月07日 17:52:58   作者:  
SQLServer2005通過(guò)intersect,union,except和三個(gè)關(guān)鍵字對(duì)應(yīng)交、并、差三種集合運(yùn)算。
他們的對(duì)應(yīng)關(guān)系可以參考下面圖示相關(guān)測(cè)試實(shí)例如下:
 
相關(guān)測(cè)試實(shí)例如下:
復(fù)制代碼 代碼如下:

use tempdb
go
if (object_id ('t1' ) is not null ) drop table t1
if (object_id ('t2' ) is not null ) drop table t2
go
create table t1 (a int )
insert into t1 select 1 union select 2 union select 3
create table t2 (a int )
insert into t2 select 3 union select 4 union select 5
go
select * from t1 union select * from t2
go
/* 求表并集
1
2
3
4
5*/
select * from t1 union all select * from t2
go
/*求表并集不過(guò)濾重復(fù)
1
2
3
3
4
5*/
select * from t1 except select * from t2
go
/*求t1對(duì)t2的差集
1
2*/
select * from t1 intersect select * from t2
go
/*求t1對(duì)t2的交集
3*/

相關(guān)文章

最新評(píng)論

航空| 高州市| 郓城县| 同仁县| 扬中市| 光山县| 泰安市| 蒙城县| 庄河市| 信宜市| 和顺县| 宾阳县| 黎城县| 华宁县| 富顺县| 旌德县| 永修县| 林周县| 凤庆县| 万安县| 翁源县| 顺义区| 章丘市| 中江县| 东港市| 镇江市| 神木县| 巫溪县| 揭阳市| 石屏县| 炉霍县| 扬州市| 桓仁| 新泰市| 肃宁县| 黄大仙区| 巢湖市| 英超| 贡嘎县| 通许县| 天水市|