String Comparison and NULL

Поиск
Список
Период
Сортировка
От seijin@gmail.com
Тема String Comparison and NULL
Дата
Msg-id 42dbc725-f6b0-471e-8a88-2a93d8cea542@y38g2000hsy.googlegroups.com
обсуждение исходный текст
Ответы Re: String Comparison and NULL  ("Pavel Stehule" <pavel.stehule@gmail.com>)
Re: String Comparison and NULL  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список pgsql-general
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';"  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
would use IS or IS NOT but this...?  I'm a little confused.

Thanks!

В списке pgsql-general по дате отправления:

Предыдущее
От: Mircea Moisei
Дата:
Сообщение: Help! ERROR: could not open relation
Следующее
От: Gerhard Wohlgenannt
Дата:
Сообщение: question/problem concerning GRANT/REVOKE