Re: If statment in query

2005-06-06 Thread SGreen
Sebastian <[EMAIL PROTECTED]> wrote on 06/05/2005 02:23:45 AM: > I have two fields: topic | title > topic does not always have data in it, so i want to select `title` when > `topic` is null.. > i thought i could do this (does not work): > IF(title IS NULL, topic, title) AS heading > Thanks. Y

Re: If statment in query

2005-06-05 Thread Michael Stassen
Sebastian wrote: I have two fields: topic | title topic does not always have data in it, so i want to select `title` when `topic` is null.. i thought i could do this (does not work): IF(title IS NULL, topic, title) AS heading Thanks. There is nothing wrong with this, as long as it is par

Re: If statment in query

2005-06-04 Thread Simon Garner
Sebastian wrote: I have two fields: topic | title topic does not always have data in it, so i want to select `title` when `topic` is null.. i thought i could do this (does not work): IF(title IS NULL, topic, title) AS heading Thanks. Try SELECT IFNULL(title, topic) AS heading -Simon -

If statment in query

2005-06-04 Thread Sebastian
I have two fields: topic | title topic does not always have data in it, so i want to select `title` when `topic` is null.. i thought i could do this (does not work): IF(title IS NULL, topic, title) AS heading Thanks. -- MySQL General Mailing List For list archives: http://lists.mysql.com/my