Re: When is a blank not a null or '' - Mailing list pgsql-general

From Berend Tober
Subject Re: When is a blank not a null or ''
Date
Msg-id 64062.216.238.112.88.1107352403.squirrel@216.238.112.88
Whole thread Raw
In response to Re: When is a blank not a null or ''  (Michael Kleiser <mkl@webde-ag.de>)
List pgsql-general
>>anyone any ideas
> If yes you should you have to use.
>
> SELECT first_name,work_email FROM tb_contacts  WHERE
>   tb_contacts.work_email <>''
> AND
>   tb_contacts.work_email IS NOT NULL;
>

See what happens with

SELECT first_name, work_email, LENGTH(COALESCE(work_email, ''))
FROM tb_contacts
WHERE LENGTH(TRIM(COALESCE(work_email, ''))) = 0


pgsql-general by date:

Previous
From: Csaba Nagy
Date:
Subject: Re: When is a blank not a null or ''
Next
From: Sean Davis
Date:
Subject: Re: When is a blank not a null or ''