Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 如何检查字符串是否为空?_Sql_Sql Server 2008 - Fatal编程技术网

Sql 如何检查字符串是否为空?

Sql 如何检查字符串是否为空?,sql,sql-server-2008,Sql,Sql Server 2008,有谁能给我一个主意,不使用下面的方法检查字符串是否为空 1. length(string) 2. Comparing string with "" 3. string ! = NULL 字符串上的use不为空 像 使用字符串不为空。使用字符串!=NULL不是有效的SQL…我不确定您的要求是什么,但您可以检查NULL using是否为NULL SELECT 1 WHERE '' IS NULL 或 你可以在不同的网站上查看天气,比如weather.yahoo.com或acuweather.co

有谁能给我一个主意,不使用下面的方法检查字符串是否为空

1. length(string)
2. Comparing string with ""
3. string ! = NULL

字符串上的use
不为空


使用
字符串不为空
。使用
字符串!=NULL
不是有效的SQL…

我不确定您的要求是什么,但您可以检查NULL using是否为NULL

SELECT 1 WHERE '' IS NULL


你可以在不同的网站上查看天气,比如weather.yahoo.com或acuweather.com:)试试ISNULL(string)keymone,它已经被修复了!珀尔:记住这一点:农夫想知道恶劣的天气是否影响了他的湿度(wether是阉割的公绵羊。)我可以在if语句中使用declare@str varchar(20)set@str=”“if(@str is not null)print'not null'或者print'null'我不知道你要把我带到哪里去。如果将值
''
赋给变量,则该变量将不会为
NULL
。是:-)我知道了。空格不被视为NULL。谢谢:-)
SELECT 1 WHERE '' IS NULL
SELECT 1 WHERE NULL IS NULL
CASE WHEN NULLIF(some_text, '') IS NULL THEN 'T' ELSE 'F' END