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: stephen O'D <stephen.odonnell_at_gmail.com>
Date: 27 Sep 2005 01:01:53 -0700
Message-ID: <1127808113.851270.276290@g49g2000cwa.googlegroups.com>

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 - 03:01:53 CDT

Original text of this message

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