MySQL Forums
Forum List  »  Newbie

Re: INSERT INTO TABLE
Posted by: Kanwal Khipple
Date: July 18, 2005 12:47PM

If for example we have:

Table A (col1, col2, col3) Table B (col1, col2)

Then what you can do is make a query that does what you need in two steps.

FIRST insert into Table A:

INSERT INTO A(col1, col2, col3)
VALUES ('Nature','Buf','')

UPDATE A
SET col3 = 'Buffalo'
WHERE col2 = 'Buf'


How does that work?

Options: ReplyQuote


Subject
Written By
Posted
July 18, 2005 11:14AM
Re: INSERT INTO TABLE
July 18, 2005 12:47PM
July 19, 2005 12:37AM
July 22, 2005 11:07AM


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.