Thursday, August 16, 2012

Cumulative Sum, Regular Expressions

I needed a sql to force users to enter data with Capital letters, a friend helped me with a regular expression, of course usage of it is not limited with this:
regexp_substr(:ATTRIBUTE_VALUES.C_ATTRIBUTE6,'[[:lower:]]') is not null

To have cumulative sums following sql can be used:
SUM(SUM( toplam_maliyet/GENEL_TOPLAM_maliyet)*100 )
OVER (ORDER BY sum (toplam_maliyet/GENEL_TOPLAM_maliyet)*100 desc ROWS UNBOUNDED PRECEDING) AS cumulative_total

No comments:

Post a Comment