MySQL Forums
Forum List  »  Newbie

ISNULL Operator equivelant from SQL Server
Posted by: Nathan Pledger
Date: July 04, 2005 01:33AM

Hi,

Am fed up of my hosting providers SQL Server performance, so am migrating to MySQL. I'm sure thats good news to all!

Anyway, while I have a good grasp of SQL, I do not have a good grasp of MySQL having only worked with it tentatively and fleetingly in the past.

I have a query similar to:

SELECT Col1,Col2,Col3,ISNULL(ColThatMayBeNull,ColToUseIfColIsNull) AS NiceCol FROM SomeTable

In MS SQL, ISNULL is used to substitute a column return value with an alternative value or column if the value is NULL. This will allow me to substitute a 'default value' that has been defined elsewhere.

However, MySQL ISNULL only accepts one argument. So how can I achieve a similar result?

My MySQL Version is 4.0

Many thanks.

Options: ReplyQuote


Subject
Written By
Posted
ISNULL Operator equivelant from SQL Server
July 04, 2005 01:33AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.