Select from same table as an Insert or Update

try:

insert into aTable select max(a)^2, 'name' from aTable;

or

insert into aTable select max(a)^2, 'name' from aTable group by B;

If you need a join, you can do this:

insert into aTable select max(a)^2, 'name' from aTable, bTable;

My “Server version” is “5.0.51b-community-nt MySQL Community Edition (GPL)”

Leave a Comment