Re: insert-select-statement doesn't take order-by-clause

2004-01-23 Thread Sven Köhler
Sorry, but your answer is not correct. FROM () and does NOT include ORDER BY ... --> your insert select will fail with syntax error Ohh, OK -- MaxDB Discussion Mailing List For list archives: http://lists.mysql.com/maxdb To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

RE: insert-select-statement doesn't take order-by-clause

2004-01-23 Thread Zabach, Elke
Sven Köhler wrote: > > > declare ordertab cursor for select col1 from table2 order by col1 > > + > > insert into table1 (col2) select * from ordertab > > The same is also possible with sub-selects: > > INSERT INTO table1(col2) SELECT * FROM > (SELECT col1 FROM table2 ORDER BY col1) > > So

Re: insert-select-statement doesn't take order-by-clause

2004-01-23 Thread Sven Köhler
declare ordertab cursor for select col1 from table2 order by col1 + insert into table1 (col2) select * from ordertab The same is also possible with sub-selects: INSERT INTO table1(col2) SELECT * FROM (SELECT col1 FROM table2 ORDER BY col1) Sorry i bothered you with this. -- MaxDB Discussion

RE: insert-select-statement doesn't take order-by-clause

2004-01-23 Thread Zabach, Elke
news [mailto:[EMAIL PROTECTED] Behalf Of Sven Köhler wrote: > hi, > > i tried to insert something like > > INSERT INTO table1(col2) > SELECT col1 FROM table2 > ORDER BY col1 > > but according to the grammer ORDER BY is not allowed. > well, you could say that the order of the rows doesn't matter

RE: insert-select-statement doesn't take order-by-clause

2004-01-23 Thread Knappke, Christian
Sven wrote: > i tried to insert something like > > INSERT INTO table1(col2) > SELECT col1 FROM table2 > ORDER BY col1 > > but according to the grammer ORDER BY is not allowed. > well, you could say that the order of the rows doesn't matter, but it > does. Imagine you've got a SERIAL-column in ta