Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> HowTo: Select from insert-table WHILE inserting
Hi,
what is the best way to get something like
insert into tablea (age,name,highestyet) select age,name,(select max(age) from tablea) from tablepersons;
or, for versions below 8i,
insert into tablea (age,name,highestyet)
select tp.age,tp.name,tt.maxage
from tablepersons tp, (select max(age) maxage from tablea) tt;
to work correctly.
These two scripts work, but maxage returns the highest age in tablea BEFORE the insert - i need the highest age WHILE the insert.
Any ideas?
The solution has to work without redefining the tables and
from an SQL script batch run.
-- Andreas Who doesn't live can never dieReceived on Wed Sep 26 2001 - 12:13:28 CDT
![]() |
![]() |