久久久精品一区ed2k-女人被男人叉到高潮的视频-中文字幕乱码一区久久麻豆樱花-俄罗斯熟妇真实视频

SQLServer中有哪些比較運(yùn)算符

SQLServer中有哪些比較運(yùn)算符,相信很多沒(méi)有經(jīng)驗(yàn)的人對(duì)此束手無(wú)策,為此本文總結(jié)了問(wèn)題出現(xiàn)的原因和解決方法,通過(guò)這篇文章希望你能解決這個(gè)問(wèn)題。

創(chuàng)新互聯(lián)公司2013年開創(chuàng)至今,先為龍井等服務(wù)建站,龍井等地企業(yè),進(jìn)行企業(yè)商務(wù)咨詢服務(wù)。為龍井企業(yè)網(wǎng)站制作PC+手機(jī)+微官網(wǎng)三網(wǎng)同步一站式服務(wù)解決您的所有建站問(wèn)題。

他們作用于比較運(yùn)算符和子查詢之間,作用類似Exists、not exists、in、not in以及其他邏輯意義,這些語(yǔ)法同樣被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 ) --無(wú)數(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 n<some(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)的比較運(yùn)算將不會(huì)返回任何結(jié)果,原因就不用多解釋了。而因?yàn)閠1和t2表的null的存在他們和not exists之類的比較符會(huì)有一些區(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) 他們邏輯上意義很像但是對(duì)于null的處理卻是恰恰相反,第一句會(huì)忽略子查詢的null而把t2的null同時(shí)查出來(lái),第二句卻是忽略了t2的null同時(shí)會(huì)因?yàn)閠1中的null而無(wú)法查詢到數(shù)據(jù)。

看完上述內(nèi)容,你們掌握SQLServer中有哪些比較運(yùn)算符的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝各位的閱讀!

分享標(biāo)題:SQLServer中有哪些比較運(yùn)算符
URL分享:http://sd-ha.com/article26/jggdcg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供企業(yè)建站、網(wǎng)站策劃、自適應(yīng)網(wǎng)站動(dòng)態(tài)網(wǎng)站、微信小程序、面包屑導(dǎo)航

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

商城網(wǎng)站建設(shè)