re: INSERT INTO from a SELECT does not work?

2002-12-20 Thread Egor Egorov
On Friday 20 December 2002 10:30, Thierry Michalowski wrote: > I'm trying to run the following SQL statement on a table of my MySQL DB: > > insert into MYTABLE(ID, VALUE, SORTKEY) >select T.ID, 'to to', MAX(T.SORTKEY) + 1 from MYTABLE as T group by > T.ID > > This was suggested by a SQL ex

Re: INSERT INTO from a SELECT does not work?

2002-12-20 Thread Paul DuBois
At 9:30 +0100 12/20/02, Thierry Michalowski wrote: Hello, I'm trying to run the following SQL statement on a table of my MySQL DB: insert into MYTABLE(ID, VALUE, SORTKEY) select T.ID, 'to to', MAX(T.SORTKEY) + 1 from MYTABLE as T group by T.ID You can't insert into the same table that y