quick (hopefully) sql Question

Soldato
Joined
13 Dec 2002
Posts
7,646
Location
Manchester City Centre
i have a table which for ease of explanation consists of
user (3 letter code) - sale_id - date

there are probably 70 distinct users, each with maybe 100 sales

is there any way to return the top 10 sales, for each user, in one query

(it would be even more helpful if someone knows how to do the same thing in crystal enterprise)
 
Which database manager are you using? The results you're after are probably acheivable in a single query but you'd need to use some kind of ranking function to do it and the availability and syntax will depend on the RDBMS being used.
 
Back
Top Bottom