Sounds like you need to use Oracle analytical func...
# general
m
Sounds like you need to use Oracle analytical functions then