MySQL Forums
Forum List  »  New in 4.1: Subqueries

Re: insert into or update with subquerys
Posted by: Georg Richter
Date: December 06, 2004 01:16PM

There is no need to use a subquery:

INSERT INTO Accounting (BytesIn, sessionID)
SELECT BytesIn, 'session1' FROM Accounting WHERE ID=2

and for the 2nd sample you can use REPLACE INTO.

Options: ReplyQuote


Subject
Views
Written By
Posted
17437
November 29, 2004 07:10AM
Re: insert into or update with subquerys
9099
December 06, 2004 01:16PM
9624
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.