婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > 被遺忘的SQLServer比較運算符謂詞

被遺忘的SQLServer比較運算符謂詞

熱門標(biāo)簽:菏澤語音電銷機器人加盟公司 知名電銷機器人價格 外呼系統(tǒng)改進 長沙智能外呼系統(tǒng) 地圖標(biāo)注牌 湖南電腦外呼系統(tǒng)平臺 電銷機器人公司 需要哪些牌照 廣東防封卡外呼系統(tǒng)原理是什么 分享百度地圖標(biāo)注多個位置
官方的參考文檔
http://technet.microsoft.com/zh-cn/library/ms187074%28SQL.90%29.aspx
他們作用于比較運算符和子查詢之間,作用類似Exists、not exists、in、not in以及其他邏輯意義,這些語法同樣被SQLServer2000支持但是很少看到有人用它們。
復(fù)制代碼 代碼如下:

set nocount on
use tempdb
go
if (object_id ('t1' ) is not null ) drop table t1
create table t1 (n int )
insert into t1 select 2 union select 3
if (object_id ('t2' ) is not null ) drop table t2
create table t2 (n int )
insert into t2 select 1 union select 2 union select 3 union select 4
select * from t2 where n> all (select n from t1 ) --4
select * from t2 where n> any (select n from t1 ) --3,4
--select * from t2 where n>some(select n from t1) --3,4
select * from t2 where n= all (select n from t1 ) --無數(shù)據(jù)
select * from t2 where n= any (select n from t1 ) --2,3
--select * from t2 where n=some(select n from t1) --2,3
select * from t2 where n all (select n from t1 ) --1
select * from t2 where n any (select n from t1 ) --1,2
--select * from t2 where nsome(select n from t1) --1,2
select * from t2 where n> all (select n from t1 ) --1,4
select * from t2 where n> any (select n from t1 ) --1,2,3,4
--select * from t2 where n>some(select n from t1)--1,2,3,4
set nocount off

注意,如果t1中包含null數(shù)據(jù),那么所有All相關(guān)的比較運算將不會返回任何結(jié)果,原因就不用多解釋了。而因為t1和t2表的null的存在他們和not exists之類的比較符會有一些區(qū)別。
比如下面兩句
select * from t2 a where not exists(select 1 from t1 where n>=a.n)
select * from t2 where n >all(select n from t1)
他們邏輯上意義很像但是對于null的處理卻是恰恰相反,第一句會忽略子查詢的null而把t2的null同時查出來,第二句卻是忽略了t2的null同時會因為t1中的null而無法查詢到數(shù)據(jù)。

標(biāo)簽:福建 天水 珠海 泉州 商洛 呼和浩特 西寧 美容院

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《被遺忘的SQLServer比較運算符謂詞》,本文關(guān)鍵詞  被,遺忘,的,SQLServer,比較,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《被遺忘的SQLServer比較運算符謂詞》相關(guān)的同類信息!
  • 本頁收集關(guān)于被遺忘的SQLServer比較運算符謂詞的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 巴彦淖尔市| 陕西省| 蓬莱市| 中山市| 郯城县| 皋兰县| 吉首市| 白城市| 股票| 三亚市| 弥勒县| 泉州市| 遵义县| 调兵山市| 家居| 民权县| 达孜县| 乐平市| 津市市| 增城市| 香格里拉县| 清水河县| 蛟河市| 乌兰察布市| 湖口县| 山阴县| 收藏| 郑州市| 邢台市| 辽阳县| 通道| 岳西县| 蚌埠市| 饶阳县| 遂川县| 扎鲁特旗| 买车| 神木县| 海口市| 蒲江县| 长汀县|