Tip Details Add a Related Tip

Rate as: Positive Negative

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: no ratings, 0 total Votes
Categories: MySQL Oracle databases
Added: on Jul 10, 2008 at 5:00 pm
Added By: an anonymous user

Comments on this Tip

Add a Comment
There are no comments for this tip
Your Comment:
(how to format)
Rate This Tip:

Verify Humanity:
Sorry, we know it's annoying, but please enter the characters shown in the image to the left so that we know you're an actual person and not an evil spammer. Thanks.
       

Related Tips

Finding slow MySQL queries

100% positive, 0 comments
– Tip added by dbdude on Jun 24, 2008 at 9:22 pm

Why you should use MySQL

no ratings, 0 comments
– Tip added by an anonymous user on May 30, 2007 at 10:02 am

How to find a good and cheap web hosting?

100% positive, 0 comments
– Tip added by an anonymous user on Mar 24, 2008 at 3:15 am

Minimize round trips to the server for best performance

100% positive, 0 comments
– Tip added by an anonymous user on Jun 18, 2008 at 4:07 pm

Importing databases in MS SQL

100% positive, 0 comments
– Tip added by an anonymous user on May 29, 2008 at 2:47 pm