Hi!

On Dec 02, George Georgeus wrote:
> Hi!
> I do not know how to use INSERT and UNION together.
> For example:
> INSERT INTO tmp_table_name (a)
> (SELECT a FROM table_name WHERE a=10 AND B=1 ORDER BY
> a LIMIT 10)
> UNION
> (SELECT a FROM table_name WHERE a=11 AND B=2 ORDER BY
> a LIMIT 10)
> ORDER BY a;
> It does not work. But I think it should. Have the
> MySQL
> developers forgotten something??
> I use MySQL 4.012

It's parser deficiency which was fixed in 4.0.14:
Manual: News-4.0.14

   * Allow `CREATE TABLE' and `INSERT' from any `UNION'.

before 4.0.14 you could only use a union without parenthesis in INSERT
or CREATE.
 
Regards,
Sergei

-- 
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <[EMAIL PROTECTED]>
 / /|_/ / // /\ \/ /_/ / /__  MySQL AB, Senior Software Developer
/_/  /_/\_, /___/\___\_\___/  Osnabrueck, Germany
       <___/  www.mysql.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to