Re: Alternative to decode() in Oracle

2002-05-31 Thread Arul
Thanx Lewis..It worked - Original Message - From: "Neville Lewis" <[EMAIL PROTECTED]> To: "MySQL" <[EMAIL PROTECTED]> Sent: Friday, May 31, 2002 12:34 PM Subject: RE: Alternative to decode() in Oracle > Have a look below: > -- >

RE: Alternative to decode() in Oracle

2002-05-30 Thread Neville Lewis
Have a look below: -- If expr1 is TRUE (expr1 <> 0 and expr1 <> NULL) then IF() returns expr2, else it returns expr3. IF() returns a numeric or string value, depending on the context in which it is used: mysql> select IF(1>2,2,3); -> 3 mysql> select IF(1<2,'yes','no');

Alternative to decode() in Oracle

2002-05-30 Thread Arul
Hi All Is there any function in mysql which acts similar like decode() in Oracle.. The decode function acts like a procedural case statement inside a single SQL statment to return different values or columns based on the the values of other columns in the select statement. It is extremely versa