How to select rows with values set to NULL

Поиск
Список
Период
Сортировка
От Tille, Andreas
Тема How to select rows with values set to NULL
Дата
Msg-id Pine.LNX.4.44.0205230957190.8932-100000@wr-linux02.rki.ivbb.bund.de
обсуждение исходный текст
Ответы Re: How to select rows with values set to NULL  (Martijn van Oosterhout <kleptog@svana.org>)
Re: How to select rows with values set to NULL  (Jani Averbach <jaa@cc.jyu.fi>)
Список pgsql-general
Hello,

InfluenzaWeb=# create table test (
InfluenzaWeb(#   id int,
InfluenzaWeb(#   txt varchar(17) default NULL);
CREATE
InfluenzaWeb=# insert into test values( 1 );
INSERT 553756 1
InfluenzaWeb=# select * from test;
 id | txt
----+-----
  1 |
(1 row)

InfluenzaWeb=# select * from test where txt = NULL;
 id | txt
----+-----
(0 rows)

InfluenzaWeb=#  insert into test values(2,'text');
INSERT 553757 1
InfluenzaWeb=# select * from test where txt like '%';
 id | txt
----+------
  2 | text
(1 row)

InfluenzaWeb=# select * from test where not txt like '%';
 id | txt
----+-----
(0 rows)

So how to get all rows which txt has the value NULL?

Kind regards

         Andreas.

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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Named constraints
Следующее
От: "Tille, Andreas"
Дата:
Сообщение: Substring from end of string