MySQL Forums
Forum List  »  New in 4.1: Subqueries

insert into or update with subquerys
Posted by: Andreas Terpotiz
Date: November 29, 2004 07:10AM

Hi

i have a problem with these queries. what is wrong and how can i make them functionaly.

insert into Accounting(BytesIn,sessionID) values ((select BytesIn from
Accounting where ID=2),'session1')

and

update Accounting set BytesIn=(select BytesIn from Accounting where ID=2)
where ID=1

Anyway, we need to address in the query other rows of the same table which
is, according to the error message, impossible.

[local] ERROR 1093: You can't specify target table 'accounting' for
update in FROM clause

Options: ReplyQuote


Subject
Views
Written By
Posted
insert into or update with subquerys
17450
November 29, 2004 07:10AM
9628
February 11, 2005 02:25AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.