PB with Null string

Поиск
Список
Период
Сортировка
Искать

PB with Null string

От:
darold <darold@neptune.fr>
Дата:
Hi,


I have tried this query to check if a field is empty:

    SELECT * FROM t_table WHERE s_string='';

where s_string is declared as text. But this doesn't work, why? Is
there's an
other way to do that ? I have also tried with NULL but I think it is not
included
in the 6.3.2...

Thank,

Gilles

Re: [GENERAL] PB with Null string

От:
Postgres DBA <postgres@nest.bistbn.com>
Дата:
Instead you should use "IS NOT NULL" or "IS NULL":
 SELECT * FROM t_table WHERE s_string IS NULL;

Aleksey

On Wed, 23 Dec 1998, darold wrote:

> Hi,
> 
> 
> I have tried this query to check if a field is empty:
> 
>     SELECT * FROM t_table WHERE s_string='';
> 
> where s_string is declared as text. But this doesn't work, why? Is
> there's an
> other way to do that ? I have also tried with NULL but I think it is not
> included
> in the 6.3.2...
> 
> Thank,
> 
> Gilles
> 
> 
> 

FAQ