I have a table that looks like this:
UID DATE GROUP VALUE
The data types are:
VARCHAR DATE VARCHAR NUMERIC
Example:
abc1000 2012-09-01 1205 1000.0000
abc1000 2012-09-01 1210 1010.0000
abc1000 2012-09-02 1205 1100.0000
abc1000 2012-09-02 1210 1020.0000
def1010 2012-09-01 1205 2000.0000
I need to find the top N(15) values (VALUE) for each unique “UID+GROUP” and AVERAGE them so the output looks like this:
abc1000 1205 1050.0000
abc1000 1210 1015.0000
def1010 1205 2000.0000
1 Answer