Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PL/SQL: Count how often a value appears and subtotal it

508560Jun 26 2006 — edited Jun 27 2006
I'm not the best at PL/SQL, but I'm trying and willing to learn.

I have some SQL that looks thru over 1 million rows in a DB and pulls back data and does decodes to make the data meaningful. My output looks like this right now

Row1 - Row2 - Row3 - Row4 - Row5
x a c d c
a c d b x
x c d b b
x x x a a
x a b b a

x = no answer
a = alpha
b = beta
c = charle
d = delta

My end goal is to try to do this: Is to try to figure out how many times x appears in a rows above, decode it from 'x' to 'no answer' and then spit out a subtotal. The same applies for A thru D as well.

Can anyone point out some PL/SQL examples that could help me out?

thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 25 2006
Added on Jun 26 2006
9 comments
748 views