Quantcast
Viewing all articles
Browse latest Browse all 5661

Rich Client (v3.1) Top 2 for each group

Hi,

 

I use BO Rich Client v3.1

 

I have a table as following:

NAME SCORE
-----------------
willy 
1
willy 
2
willy 
3
zoe 
4
zoe 
5
zoe 
6


 

The aggregation function for group by only allow me to get the highest score for each name. I made a query to get the highest 2 score for each name, My output is

NAME SCORE
-----------------
willy 
2
willy 
3
zoe 
5
zoe 
6

 

My SQL request is

 

SELECTNAME, SCOREFROM  test s WHERE(

     SELECT  COUNT(*)FROM  test f WHERE f.name = s.name AND f.score >= s.score

     )<=2


My problem is I don't know how to create this request with BO Rich Client v3.1 .... I tried to user SQL personalized but I have any errors (parameters 0 instead 2) ... How can I do?


Yannick


Viewing all articles
Browse latest Browse all 5661

Trending Articles