Re: (How) are subqueries optimized involving the same table?
Hi,
no recursion. I just want to insert a record which is related to another record in another table.
In other words:
I'd just like to insert a new record into a table, which (the new record) is supposed to fetch some fields from a record in another table. (For reasons irrelevant here, this behavior is desired, even though is it not normalized, and foreign keys are not passable here also.)
This could easily achieved via subqueries, but I dont't want to call the same table multiple times.
Sorry, example was misleading. New one:
INSERT INTO
t1
SET
t1.field1 = (SELECT field1 FROM t2 WHERE t2.id = 45),
t1.field2 = (SELECT field2 FROM t2 WHERE t2.id = 45),
t1.field3 = (SELECT field3 FROM t2 WHERE t2.id = 45)
Thanks.
Edited 1 time(s). Last edit at 07/13/2006 08:41AM by Jakobus Dornier.
Subject
Views
Written By
Posted
2677
July 13, 2006 08:02AM
1950
July 13, 2006 08:12AM
1933
July 13, 2006 08:20AM
1778
July 13, 2006 08:33AM
Re: (How) are subqueries optimized involving the same table?
1977
July 13, 2006 08:40AM
1791
July 13, 2006 08:53AM
1720
July 13, 2006 08:57AM
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.