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

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL querry

Re: SQL querry

From: Randy DeWoolfson <randyd_at_cais.com>
Date: Tue, 30 Nov 1999 13:59:30 -0500
Message-ID: <38441E92.752EFF5F@cais.com>


use a trigger,

increment/decrement the total in another table whenever the value is inserted
( also when it is modified, or deleted, i bet )

randy

minkuarora_at_yahoo.com wrote:
>
> Hi all
>
> I have got a table something like this
>
> Dim-Id Dim Value Limit Status
>
> Product p1 Y
> Product p2 Y
> Product p3 N
> Market M1 N
> Market M2 Y
>
> Now i want records from the table which shoud be
> something like this
>
> Product p1 Y 1
> Product p2 Y 2
> Market M2 Y 1
>
> In othere words wherever the limit Status flag is set to Y the count
> should start increasing and whenever the Dim-Id changes the count
> should again start from 1
> rownum would not help me in having this kind of numbering since it will
> give me a incremental numbering .....can u give me some idea how
> should i do ?
>
> I hope i am clear with the problem
>
> Thanks and Regards
>
> Parvinder
>
> P.S : I can keep a field for the number but the whole point is i have
> to how will i update that field ...since they have to be updated as per
> Limit Status Flag and everytime the flag value changes i hve to fire a
> process which will do the renumbering but how will i do the updation of
> the numbering in other words what kind of SQL querry would it be to do
> the renumbering ???
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Tue Nov 30 1999 - 12:59:30 CST

Original text of this message

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