The IF function works pretty much like Oracle's decode.  But I recommend
using CASE..WHEN for compatibility between the two.

Check out:
http://www.mysql.com/doc/en/Control_flow_functions.html


> -----Original Message-----
> From: Jonathan Rosenberg [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, November 12, 2003 4:54 PM
> To: [EMAIL PROTECTED]
> Subject: Equivalent Function Needed
> 
> 
> I use the following function in Oracle
> SELECT decode(status,'A','Active','L','Active','Former') FROM Table
> 
> What it means is: if table column status = A, return 
> "Active", if status=L, return "Active", else return "Former" 
> in the select statement.
> 
> Decode in mysql has nothing to do with this functionality and 
> I didn't see a function while browsing the docs online that 
> did this.  Is there an equivalent function in mySQL?
> 
> Thanks
> 
> 
> *********************
> Jon Rosenberg
> www.DeanForAmerica.com
> www.OhioForDean.org
> 


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to