开发者

How to check whether a string is null or not?

Could any one give me an idea to check whether a string is null or not without making use of followin:

1. length(string)
2. Comparing string with ""
3开发者_Python百科. string ! = NULL


use IS NOT NULL on String

Like

SELECT * FROM table WHERE someString IS NOT NULL


Use string IS NOT NULL. Using string != NULL is not valid SQL...


I'm not sure exactly what your asking, but you can check for null using IS NULL;

SELECT 1 WHERE '' IS NULL

or

SELECT 1 WHERE NULL IS NULL


CASE WHEN NULLIF(some_text, '') IS NULL THEN 'T' ELSE 'F' END
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜