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 -> How to count how many times a field value changes ?

How to count how many times a field value changes ?

From: <xavier.grosjean_at_thepentagon.com>
Date: Thu, 16 Apr 1998 11:09:11 -0600
Message-ID: <6h5af6$f18$1@nnrp1.dejanews.com>


Hello

I'm quite new to sql, plsql and Pro-C. Do not laught, I DID NOT ask for it ! My problem is:
How to count how many times one column value changes, in relation to one other column value
Ex: How many times does col2 change of values here : col1 col2
111 221

111    222      change 1
111    221      change 2
111    222      change 3
112    221      change 4
112    221
112    222      change 5

112 222
112 222
113 221 not a change: col1 is not the same ! 113 221
113    222      change 6
113    221      change 7
113    223      change 8

I think it might not be done by one single request, and probably needs a pls/sql program, with a cursor. But I thought I would ask, just in case. So please, let me know !
Regards and thanks.
Xavier

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading Received on Thu Apr 16 1998 - 12:09:11 CDT

Original text of this message

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