List:General Discussion« Previous MessageNext Message »
From:Mark Matthews Date:December 24 2002 8:26pm
Subject:Re: 4.1 questions: subqueries which use dual
View as plain text  
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Richard Clarke wrote:
> Dan,
>     According to http://www.mysql.com/doc/en/News-4.1.0.html
> 
>     "SELECT ... FROM DUAL is an alias for SELECT .... (To be compatible with
> some other databases)."
> 
> Your example does work however.
> 
> mysql> select * from ( select 1 ) d;
> +---+
> | 1 |
> +---+
> | 1 |
> +---+
> 1 row in set (0.00 sec)
> 
> Richard.

The 'dual' syntax is simply re-written to remove the 'from dual' part so 
you end up with 'select 1'. It's also rather new functionality in 4.1.

I'm pretty sure this logic has not yet been propagated to the code for 
subqueries. I'm CC'ing the developer responsible for subqueries (Sanja 
Belkin) on this message so that he is made aware of this issue. It will 
be important for those moving from Oracle to MySQL or those users used 
to Oracle-isms :)

Thanks for bringing this issue to our attention! Have a good holiday!

	-Mark
- -- 
MySQL 2003 Users Conference -> http://www.mysql.com/events/uc2003/

For technical support contracts, visit https://order.mysql.com/?ref=mmma

     __  ___     ___ ____  __
    /  |/  /_ __/ __/ __ \/ /  Mark Matthews <mark@stripped>
   / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer - JDBC/Java
  /_/  /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA
         <___/ www.mysql.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.1.90 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE+CML6tvXNTca6JD8RAnsuAJ9lYGc1DQ58m+8bEZHYeYs5Ilh3ZACgn/Ln
kwlop2SgxA9/+KCUqyYn3Sk=
=zFvh
-----END PGP SIGNATURE-----

Thread
Return every Nth row in a result setSpamSucks8622 Dec
  • RE: Return every Nth row in a result setJamesD22 Dec
  • 4.1 questions: subqueries which use dualric22 Dec
    • re: 4.1 questions: subqueries which use dualVictoria Reznichenko24 Dec
  • Re: Return every Nth row in a result setric22 Dec
    • RE: Return every Nth row in a result setSpamSucks8622 Dec
      • Re: Return every Nth row in a result setBenjamin Pflugmann22 Dec
        • RE: Return every Nth row in a result setSpamSucks8622 Dec
          • Re: Return every Nth row in a result setRichard Clarke22 Dec
          • Re: Return every Nth row in a result setric22 Dec
  • Re: 4.1 questions: subqueries which use dualRichard Clarke24 Dec
    • Re: 4.1 questions: subqueries which use dualDan Nelson24 Dec
  • Re: 4.1 questions: subqueries which use dualRichard Clarke24 Dec
    • Re: 4.1 questions: subqueries which use dualMark Matthews24 Dec