MySQL Forums
Forum List  »  Newbie

Re: Referencing other columns at INSERT
Posted by: Xeon Masters
Date: August 28, 2004 02:31PM

Hi,

Hmm, what if the table have other columns which doesn't involves the primary key, like this:

CREATE TABLE somename (
ID INT NOT NULL AUTO_INCREMENT,
data1 VARCHAR(32),
data2 VARCHAR(32),
est_time DATE,
name VARCHAR(32),
PRIMARY KEY(ID)
);

mysql> insert into A
VALUES
(NULL, 'blah1', 'blah2', ..., CONCAT_WS('_','somethingfancy',LAST_INSERT_ID()+1));

Will the above works?

TIA

Options: ReplyQuote


Subject
Written By
Posted
Re: Referencing other columns at INSERT
August 28, 2004 02:31PM


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.