Re: When is a blank not a null or ''

From: "Berend Tober" <btober(at)computer(dot)org>
To: "mike" <mike(at)redtux1(dot)uklinux(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: When is a blank not a null or ''
Date: 2005-02-02 13:53:23
Message-ID: 64062.216.238.112.88.1107352403.squirrel@216.238.112.88
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sean Davis 2005-02-02 14:05:25 Re: When is a blank not a null or ''
Previous Message Csaba Nagy 2005-02-02 13:42:52 Re: When is a blank not a null or ''