Re: problem selecting rows with null value

Поиск
Список
Период
Сортировка
Искать
От
Jord Tanner
Тема
Re: problem selecting rows with null value
Дата
Msg-id
1047516930.24847.114.camel@gecko
Ответ на
Список
Дерево обсуждения
Re: problem selecting rows with null value Matthew Phillips <mphillips@timing.com>
Use 'IS NULL' or 'IS NOT NULL' like this:

	select * from pleah where bar IS NULL;

'=' does not work for null values.

On Wed, 2003-03-12 at 16:47, Matthew Phillips wrote:
> I am sure that I am doing something subtly wrong with my sql syntax 
> here. I thought that it was a timestamp null column issue, but it 
> doesn't work with int either. Is there a special way to denote the null 
> value in a situation like this that I don't know about?
> 
> tsc=# create table pleah(
> tsc(# foo INT NOT NULL,
> tsc(# bar timestamp DEFAULT NULL );
> CREATE TABLE
> tsc=# insert into pleah (foo) values (1);
> INSERT 206475246 1
> 
> ###ok here I would just like to select that row that I just inserted... 
> but no!
> 
> tsc=# select * from pleah where bar = NULL;
>  foo | bar
> -----+-----
> (0 rows)
> 
> tsc=# select * from pleah;
>  foo | bar
> -----+-----
>    1 |
> (1 row)
> 
> thanks muchly
> matthew
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
> http://archives.postgresql.org
-- 
Jord Tanner 

В списке pgsql-general по дате отправления
От: Joshua Moore-Oliva
Дата:
От: Taral
Дата:
FAQ