Re: [GENERAL] String Comparison and NULL

2008-04-30 Thread seijin
On Apr 29, 7:36 am, [EMAIL PROTECTED] (Tom Lane) wrote: > Andreas Kretschmer <[EMAIL PROTECTED]> writes: > >>> ... and I do something like "select id where animal <> 'Cat';" then > >>> shouldn't 1, 3, 4 and 5 be picked? As it is I only get 1, 4 and 5. > >>> NULL is not 'Cat'. I realize that if I

Re: [GENERAL] String Comparison and NULL

2008-04-29 Thread Tom Lane
Andreas Kretschmer <[EMAIL PROTECTED]> writes: >>> ... and I do something like "select id where animal <> 'Cat';" then >>> shouldn't 1, 3, 4 and 5 be picked? As it is I only get 1, 4 and 5. >>> NULL is not 'Cat'. I realize that if I were testing for NULL itself I > NULL is nothing, you can't co

Re: [GENERAL] String Comparison and NULL

2008-04-29 Thread Stephan Szabo
On Mon, 28 Apr 2008 [EMAIL PROTECTED] wrote: > I'm fairly new to PG and databases in general so this may very well be > a problem in my thought process. > > If I have a simple table with an ID (integer) and Animal (text) like > this... > > 1 Dog > 2 Cat > 3 NULL > 4 Horse > 5 Pig > 6 Cat > 7 Cat >

Re: [GENERAL] String Comparison and NULL

2008-04-29 Thread Andreas Kretschmer
Pavel Stehule <[EMAIL PROTECTED]> schrieb: > > ... and I do something like "select id where animal <> 'Cat';" then > > shouldn't 1, 3, 4 and 5 be picked? As it is I only get 1, 4 and 5. > > NULL is not 'Cat'. I realize that if I were testing for NULL itself I NULL is nothing, you can't compare

Re: [GENERAL] String Comparison and NULL

2008-04-29 Thread Pavel Stehule
Hello 2008/4/28 <[EMAIL PROTECTED]>: > Hi, > > I'm fairly new to PG and databases in general so this may very well be > a problem in my thought process. > > If I have a simple table with an ID (integer) and Animal (text) like > this... > > 1 Dog > 2 Cat > 3 NULL > 4 Horse > 5 Pig > 6 Cat > 7 Cat

[GENERAL] String Comparison and NULL

2008-04-29 Thread seijin
Hi, I'm fairly new to PG and databases in general so this may very well be a problem in my thought process. If I have a simple table with an ID (integer) and Animal (text) like this... 1 Dog 2 Cat 3 NULL 4 Horse 5 Pig 6 Cat 7 Cat ... and I do something like "select id where animal <> 'Cat';" t