Pick top 5 from data

dassuz

New member
Local time
Today, 19:01
Joined
Jan 10, 2019
Messages
4
Hi I have a table with hundreds of line of data which has been sorted by username and date1. I want to bring back the top 5 records for each username. What is the best way to do this in a query. Example data is the attachment with the way I would like the data to look once its complete
 

Attachments

Last edited:
Hi. Welcome to AWF! Here's one more link for the same thing.
 
is that that field from a query?

use this query against that query:
Code:
select queryName.* from queryName 
where  
     (select count("1") from queryName as t1 
           where t1.username=queryName.username and 
           t1.mydatefield>= queryName.mydatefield) < 6;
 

Users who are viewing this thread

Back
Top Bottom