On Tuesday 21 August 2007 10:54:59 Tris wrote:
> Ello all...
>
> I've got 2 fields.
> Depending on the result, one might be NULL, this is intentional.
> However, if the 2nd IS null, I want to combine it with eh first...
> eg:
> field1                | field2
> sign up               | NULL
> points claimed        | NULL
> points spent  | claimed prize X
>
> So in my output I want a new field to be created using CONCAT
>
> CONCAT(field1, " - ", field2) as field1
>
> so I WANT the output of field1 to be:
> sign up
> points claimed
> points spent - claimed prize X
>
> but I'm getting a blank field1 if field 2 is null...

select if(field2 is null, field1, concat(field1, ' - ', field2)) ...

Something like that ought to do it.

(This seems like a very strange DB schema... :) )


-- 
David Precious :: [EMAIL PROTECTED]
http://blog.preshweb.co.uk/ :: http://www.preshweb.co.uk/

____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or
use the web interface http://e-newsletters.internet.com/discussionlists.html/
       Send Your Posts To: wdvltalk@lists.wdvl.com
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016

Please include the email address which you have been contacted with.

Reply via email to