Reputation: 534
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. string ! = NULL
Upvotes: 2
Views: 2596
Reputation: 6354
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
Upvotes: 0
Reputation: 26682
Use string IS NOT NULL
. Using string != NULL
is not valid SQL...
Upvotes: 3
Reputation: 15473
use IS NOT NULL
on String
Like
SELECT * FROM table WHERE someString IS NOT NULL
Upvotes: 7