Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Better way to do this
Hi all,
I have a table looks like this:
create table t_history
(
c_id number,
start_date date,
end_date date,
c1 number ,
c2 number,
...
cn
);
right now I need to return c1,...,cn in a plsql block like this(pseudo):
select (select c1 from t_history where end_date = a.start_date and
c_id=a.c_id) as old_c1, a.c1 as new_c1,...
from t_history a
where a.c_id=input_cid
This audit table has dozens of columns need to be returned in same way in one returning cursor, is there a better way?
TIA -s Received on Mon Jun 16 2003 - 19:21:37 CDT
![]() |
![]() |