Re: numeric fields and null

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: numeric fields and null
Дата
Msg-id 20030522152454.P46888-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на numeric fields and null  (Don Park <donp+postgresql@klickitat.st>)
Ответы Re: numeric fields and null  (Alexey Dashevsky <alex@kpgaz.chernigov.ua>)
Список pgsql-sql
On Thu, 22 May 2003, Don Park wrote:

> Im trying to pull out all records in a table where field
> 'postaladdressid=null' but I cant figure this out.
>
> \d users
> ....
> id               | numeric
> postaladdressid  | numeric
> ....
>
> adhoc=# update users set postaladdressid=null where id=50;
> UPDATE 1
>
> adhoc=# select id,postaladdressid from users where postaladdressid=null;
>  id | postaladdressid
> ----+-----------------
> (0 rows)
>
> Why did it not select record 50?

Because NULL=NULL is not true (it's unknown).  Use IS NULL if you want to
see if something is NULL.



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

Предыдущее
От: Guy Fraser
Дата:
Сообщение: Re: numeric fields and null
Следующее
От: Franco Bruno Borghesi
Дата:
Сообщение: Re: numeric fields and null