Referencing other columns at INSERT
Hi,
I'm trying to insert some composite value which depends on other column of the same row. I've tried this:
CREATE TABLE A (
pid INT NOT NULL AUTO_INCREMENT,
name VARCHAR(32),
PRIMARY KET(pid)
);
INSERT INTO A VALUES (
NULL, concat_ws('_', 'somethingfancy', pid)
);
The problem is the 'name' column will always be 'somethingfancy_0'. What I need is the primary key to be appended to 'somethingfancy_'. Can anybody help?
FYI I'm using MySQL 3.23.58 on Win98se box.
TIA
Subject
Written By
Posted
Referencing other columns at INSERT
August 26, 2004 02:06PM
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.