MySQL Decode Equivalent
For all of you former Oracle users that are now using MySQL and looking for a MySQL equivalent to the DECODE statement in Oracle, the command you want is IF. Unlike the DECODE statement it takes one fewer parameter, the first parameter is an expression so you don't have to give two parameters to figure out which value to return. But aside from that, IF behaves just like DECODE. You can read about the statement in the MySQL doc pages here: http://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html#function_if
| Rating: | 100% positive, 1 Vote |
| Categories: | MySQL Oracle databases |
| Added: | on Jul 10, 2008 at 5:00 pm |
| Added By: | an anonymous user |
| Searches: | mysql oracle decode database statement |

