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