Bhuvan A writes: > > If you compare a NULL with anything you don't get a true value whether > > you're comparing with =, !=, <, >, etc... That's how it's defined to > > behave. > > where did you get this definition of behaviour!? is it applicable only to > postgres or ..? its quite strange yaar!
It's how the SQL standard defines it. If other database software claims to comply to SQL it should also behave that way. (Before you complain about the SQL standard, its definition was adopted from the common mathematical notion of three-valued Boolean logic.) If you want a <> b to return true if one of a and b is NULL and the other is not NULL then you will have to do a bit more work. For example, (a <> b) or (a is null and b is not null) or (a is not null and b is null) -- Peter Eisentraut [EMAIL PROTECTED] ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly