MySQL Forums
Forum List  »  Newbie

Re: INSERT INTO TABLE
Posted by: Felix Geerinckx
Date: July 19, 2005 12:37AM

Adwait Joshi wrote:

> I have a table named A which has all the columns of table B plus some other columns, I want to
> insert data in to A from B however during this update I also want to set the values for the
> columns in A that are not in B how can I write the SQL syntax for the same?

Put the extra values as literals in the SELECT:

INSERT INTO A (CATEGORY, GROUPID, TFILE, BFILE)
SELECT 'Nature', 'BUF', TFILE, BFILE FROM B;

--
felix
Please use BBCode to format your messages in this forum.

Options: ReplyQuote


Subject
Written By
Posted
July 18, 2005 11:14AM
July 18, 2005 12:47PM
Re: INSERT INTO TABLE
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.