久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

is not null 和 <>' 有什么區別'

what#39;s the difference between is not null and lt;gt;#39; #39;(is not null 和 lt;gt; 有什么區別)
本文介紹了is not null 和 <>' 有什么區別'的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

看我的例子,兩個代碼有什么區別?

Look my example, what's the difference between two codes?

Select name from customers where name is not null

Select name from customers where name <> ''

推薦答案

他們做完全不同的事情.

They do completely different things.

Select name from customers where name is not null

此選項選擇在名稱字段中具有值的任何客戶.這些值可以包括"以及諸如山姆"、約翰瓊斯"、漂亮的金發女孩"之類的內容.

This one selects any customer who has a value in the name field. Those values can include '' as well as things like 'Sam', 'John Jones', 'pretty blonde girl'.

Select name from customers where name <> ''

這將選擇至少在 Sql Server 中不為空或空白的所有名稱.其他數據庫可能會以不同的方式處理此問題.它還排除 Null 的原因是 Null 不能作為比較的一部分,因為它的定義意味著我們不知道該字段的值是什么.

This will select all names that are not null or blank In Sql Server at least. Other databases may handle this differently. The reason why it also excludes Null is that Null cannot be part of a comparison since it by definition means we don't have a clue what the value of this field is.

如果您想同時返回真實姓名和空值,并且只排除空字符串.在 SQL Server 中,您將執行以下操作:

If you wanted to return both real names and null values and only exclude the empty strings. In SQl Server you would do:

Select name from customers where coalesce(name, 'Unknown') <>''

這篇關于is not null 和 &lt;&gt;' 有什么區別'的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

SQL - Select all when filter value is empty(SQL - 過濾器值為空時全選)
How and where do I set the MAXRECURSION option?(如何以及在何處設置 MAXRECURSION 選項?)
TABLOCKX versus SERIALIZABLE(TABLOCKX 與可序列化)
TSQL Constants... Use Variable or Literal?(TSQL 常量...使用變量還是文字?)
TSQL RIGHT String function not working(TSQL RIGHT 字符串函數不起作用)
What is the comparative speed of temporary tables to physical tables in SQL?(SQL中臨時表與物理表的比較速度是多少?)
主站蜘蛛池模板: 国产综合在线视频 | 日本欧美国产 | av色站 | 福利视频一二区 | 欧美精品成人 | 欧美大片一区 | 97超碰人人 | 奇米在线| 一级免费视频 | 久久久女女女女999久久 | 国产视频一区二区 | 亚洲欧美日韩精品久久亚洲区 | 亚洲一区视频在线 | 日韩欧美精品在线 | 日本三级在线网站 | 久久久久久91 | 久久在线 | 中文久久| 激情六月丁香 | 欧美成人免费 | 中文字幕啪啪 | 成人免费毛片在线观看 | 欧美日韩国产一区二区三区 | 久久com | 国产乱码精品一区二区三区忘忧草 | 欧美日韩亚洲一区 | 欧美精品一区二区三区在线 | 国产99久久精品一区二区永久免费 | 韩日av在线| 九热在线| 欧美日本一区 | 天堂在线www| 欧美日韩一区在线播放 | 综合另类 | 亚洲色图综合 | 2021狠狠干 | 中文字幕成人av | 欧美一级欧美三级在线观看 | 中文字幕免费在线观看 | 宅女噜噜66国产精品观看免费 | 插插插干干干 |