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 versatile and can get you out of many tight spots. It was a
favorite hacker tool before PL/SQL and worth learning how to drive.

Mind you, decode() is not ANSI, and I have not seen it in the other major
RDBMS offerings. Its one of the really nice things Oracle provides. (OK, so
MS-Access provides "iif", but these have to be nested and it gets ugly).

-Arul


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to