Subject | Copying rows into tables |
---|---|
Author | yaedos2000 |
Post date | 2005-03-03T13:47:30Z |
Hi,
I'm trying to develop an executable procedure for copying a specified
row from one table to another. So far I've got the following:
INSERT INTO TABLE_2 SELECT * FROM TABLE_1 WHERE ID = :SOMETHING;
This works fine if ID is a primary key, as only one result is
returned. However, ID isn't necessarily unique and there could be
multiple rows returned. How could the above statement be re-written
to take account of this?
Thanks
I'm trying to develop an executable procedure for copying a specified
row from one table to another. So far I've got the following:
INSERT INTO TABLE_2 SELECT * FROM TABLE_1 WHERE ID = :SOMETHING;
This works fine if ID is a primary key, as only one result is
returned. However, ID isn't necessarily unique and there could be
multiple rows returned. How could the above statement be re-written
to take account of this?
Thanks