Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help with a query
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