I have to copy some records from one table into the same table is it posible?
my sql is like this: INSERT INTO equipamento_componentes (cod_equipamento_componentes, cod_tipo, numero, data_colocacao, cod_componente) SELECT '', 'C', 65, NOW(), EQ.cod_componente FROM equipamento_componentes EQ WHERE (EQ.cod_tipo='C' and EQ.numero=1) The table is like this: cod_equipamento_componentes int auto_increment cod_tipo char numero int data_colocacao date cod_componente int (FK references another table) I get an erro saying that i cannot use that table in the select, the table is a InnoDB. Can i use the same table in the insert into select? do i have to use a temporary table? If anybody have a solution i would be very gratefull. Thanks. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]