Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Help with a query

Re: Help with a query

From: <paulhux174_at_hotmail.com>
Date: 27 Sep 2005 03:20:47 -0700
Message-ID: <1127816447.339997.245950@g49g2000cwa.googlegroups.com>


Sorry pretend the last column is not there, I put that in to show each before and after record pair (in the case of Inserts - no pair).

stephen O'D wrote:
> paulhux174_at_hotmail.com wrote:
> > Help with a query
> >
> > Table1
> > Name val2 UIDchild UIDParent SequenceID Action
> > Bill B 20 1 Insert
> > Bill B2 21 20 2 Update
> > Bill B3 23 21 3 Update
> > Tom G 22 4 Insert
> > Tom G2 24 22 5 Update
> >
> >
> >
> > I need a query that will give me a Before and After shot of this log
> > table per entry as below.
> >
> > This col not real
> > Bill B 20 1 Insert no before
> > Bill B 20 1 Insert before
> > Bill B2 21 20 2 Update after
> > Bill B2 21 20 2 Update before
> > Bill B3 23 21 3 Update after
> > Tom G 22 4 Insert no before
> > Tom G 22 4 Insert before
> > Tom G2 24 22 5 Update after
>
> I cannot see how you are going to work out the before, after etc as
> part of a virtual column. If you actually add that column to the
> table, you could populate it with a trigger at insert time. Would it
> not be better to simply add a sequence, or date column to the table,
> and use that to work out your history information?
Received on Tue Sep 27 2005 - 05:20:47 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US