Re: [GENERAL] When is a blank not a null or ''

2005-02-02 Thread Michael Kleiser
Maybe other whitspace or non-printable-character. Try: SELECT first_name, '[' || work_email || ']', ASCII(work_email) FROM tb_contacts WHERE tb_contacts.work_email <>''; mike wrote: On Wed, 2005-02-02 at 11:31 +0100, Troels Arvin wrote: On Wed, 02 Feb 2005 09:59:30 +, mike

Re: [GENERAL] When is a blank not a null or ''

2005-02-02 Thread Sean Davis
Did you try something like: select first_name, work_email FROM tb_contacts WHERE tb_contacts.work_email !~ '^\\s$'; If this works, then you may want to do something like: update tb_contacts set work_email=NULL where work_email ~ '^\\s$'; to "clean" the data and then use a trigger to do the same pro

Re: [GENERAL] When is a blank not a null or ''

2005-02-02 Thread Berend Tober
>>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 W

Re: [GENERAL] When is a blank not a null or ''

2005-02-02 Thread Csaba Nagy
[snip] > Or if there are also blanks among those e-mail addresses: > > SELECT first_name,work_email FROM tb_contacts WHERE > tb_contacts.work_email IS NOT NULL AND tb_contacts.work_email != ''; The "tb_contacts.work_email IS NOT NULL" clause is superfluous, the other condition will evaluate to f

Re: [GENERAL] When is a blank not a null or ''

2005-02-02 Thread Martijn van Oosterhout
Try: SELECT first_name,'['||work_email||']' FROM tb_contacts WHERE tb_contacts.work_email <>''; Maybe you have spaces? On Wed, Feb 02, 2005 at 09:59:30AM +, mike wrote: > I have the following query (I have removed all nulls from the field as > test) > > SELECT first_name,work_email FROM tb

Re: [GENERAL] When is a blank not a null or ''

2005-02-02 Thread mike
On Wed, 2005-02-02 at 11:26 +0100, Alban Hertroys wrote: > mike wrote: > > I have the following query (I have removed all nulls from the field as > > test) > > > > SELECT first_name,work_email FROM tb_contacts WHERE > > tb_contacts.work_email <>''; > > > > However I get loads of blank email addr

Re: [GENERAL] When is a blank not a null or ''

2005-02-02 Thread Chris Green
On Wed, Feb 02, 2005 at 09:59:30AM +, mike wrote: > I have the following query (I have removed all nulls from the field as > test) > > SELECT first_name,work_email FROM tb_contacts WHERE > tb_contacts.work_email <>''; > > However I get loads of blank email addresses coming up > Maybe you ha

Re: [GENERAL] When is a blank not a null or ''

2005-02-02 Thread mike
On Wed, 2005-02-02 at 11:31 +0100, Troels Arvin wrote: > On Wed, 02 Feb 2005 09:59:30 +, mike wrote: > > > SELECT first_name,work_email FROM tb_contacts WHERE > > tb_contacts.work_email <>''; > > > > However I get loads of blank email addresses coming up > > > > anyone any ideas > > An ide

Re: [GENERAL] When is a blank not a null or ''

2005-02-02 Thread Michael Kleiser
mike wrote: I have the following query (I have removed all nulls from the field as test) SELECT first_name,work_email FROM tb_contacts WHERE tb_contacts.work_email <>''; However I get loads of blank email addresses coming up anyone any ideas ---(end of broadcast)

Re: [GENERAL] When is a blank not a null or ''

2005-02-02 Thread Alban Hertroys
mike wrote: Try this: SELECT first_name,work_email FROM tb_contacts WHERE tb_contacts.work_email IS NOT NULL; Or if there are also blanks among those e-mail addresses: SELECT first_name,work_email FROM tb_contacts WHERE tb_contacts.work_email IS NOT NULL AND tb_contacts.work_email != ''; no diff

Re: [GENERAL] When is a blank not a null or ''

2005-02-02 Thread Sean Davis
Is there a newline or carriage return in the "blank" emails? Sean On Feb 2, 2005, at 4:59 AM, mike wrote: I have the following query (I have removed all nulls from the field as test) SELECT first_name,work_email FROM tb_contacts WHERE tb_contacts.work_email <>''; However I get loads of blank email

Re: [GENERAL] When is a blank not a null or ''

2005-02-02 Thread Alban Hertroys
mike wrote: I have the following query (I have removed all nulls from the field as test) SELECT first_name,work_email FROM tb_contacts WHERE tb_contacts.work_email <>''; However I get loads of blank email addresses coming up anyone any ideas A blank is never a NULL: SELECT '' IS NULL; ?column? --

Re: [GENERAL] When is a blank not a null or ''

2005-02-02 Thread Troels Arvin
On Wed, 02 Feb 2005 09:59:30 +, mike wrote: > SELECT first_name,work_email FROM tb_contacts WHERE > tb_contacts.work_email <>''; > > However I get loads of blank email addresses coming up > > anyone any ideas An idea: You have " "-values in your work_email column, i.e. work_email values co