MySQL Forums
Forum List  »  Oracle

Re: mySQL functions
Posted by: Josh Chamas
Date: December 26, 2004 09:20PM

Aaron Gusman wrote:
> Hi,
>
> I would like to know wheter the
> IF(expr1,expr2,expr3) function and some other
> things like variables (Ex: SET @counter=0;) are in
> the SQL standard 92 or if they are just functions
> that can be used on a mySQL database and not on
> any other database like ORACLE.
>
> Can you tell me where can I find this kind of
> information please?
>

The SQL 2003 specification draft can be found here:

http://www.wiscorp.com/sql/sql_2003_standard.zip

I believe the CASE statement is portable between MySQL & Oracle, as in:

mysql> select case when 1>0 then 1 else 0 end, 1 from dual;
+---------------------------------+---+
| case when 1>0 then 1 else 0 end | 1 |
+---------------------------------+---+
| 1 | 1 |
+---------------------------------+---+

which should work at least in Oracle 8i and MySQL 4.1.x and up. Maybe earlier versions for each too. For Mysql, I think the IF() function is proprietary, and the earlier equivalent in Oracle I believe is DECODE().

Regards,

Josh

Josh Chamas
Director, Professional Services
MySQL Inc., www.mysql.com
Get More with MySQL! http://www.mysql.com/consulting

Options: ReplyQuote


Subject
Views
Written By
Posted
4188
December 20, 2004 04:10AM
Re: mySQL functions
2731
December 26, 2004 09:20PM
2310
January 11, 2005 03:10PM
2250
August 04, 2006 08:32AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.