久久久久久久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中臨時表與物理表的比較速度是多少?)
主站蜘蛛池模板: 国产ts人妖一区二区三区 | 欧美一区二区三区在线观看视频 | 欧美第一页 | www.久久国产精品 | 久久99视频 | 欧美日韩精品专区 | av网站在线免费观看 | 日韩影院在线 | 色婷婷av一区二区三区软件 | 久久综合av| 日韩电影一区 | 日中文字幕在线 | 中文成人在线 | 婷婷中文字幕 | 国产成人小视频 | 精品久久久久久久久久久 | 日本亚洲一区二区 | 国产亚洲精品综合一区 | 成人av久久| 色综合99 | 久久久一区二区三区 | 亚洲色片网站 | 福利成人 | 国产激情免费视频 | 日韩精品久久一区二区三区 | 欧美视频第三页 | 精品一区二区三区入口 | 99在线视频观看 | 国内自拍偷拍一区 | 国产91色在线 | 亚洲 | 国产精品久久久久久久久免费相片 | 精品福利一区二区三区 | 中文字幕精品视频 | 青青草一区二区 | 久久久久一区二区三区四区 | 国产精品精品视频一区二区三区 | 欧美一区二区三区久久精品视 | 免费在线观看成人 | 久久国产精品久久久久久 | 国产精品二区三区 | 国产精品久久久久久久久久久免费看 |