List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:September 12 2002 6:56pm
Subject:Re: Vaibhav Difference between amount <> null and amount is not null
View as plain text  
In the last episode (Sep 12), compo  guy said:
> What is the difference between the following sql queries written to
> extract tuples with the field amount having non null value:
>      select loan_number from loan where amount <> null (It returns
> an empty set)
>      select loan_number from loan where amount is not null(It
> returns the expected result).

NULL is a special value.  it can only be compared with "IS NULL" or "IS
NOT NULL".  "= NULL" and "<> NULL" always return false.

http://www.mysql.com/doc/en/Working_with_NULL.html 

-- 
	Dan Nelson
	dnelson@stripped
Thread
Vaibhav Difference between amount <> null and amount is not nullcompo  guy12 Sep
  • Re: Vaibhav Difference between amount <> null and amount is not nullVlatko Surlan12 Sep
  • Re: Vaibhav Difference between amount <> null and amount is not nullDan Nelson12 Sep