Mar 19, 2003 #1 James1981 Programmer Nov 2, 2002 76 US Hi, Is there a way in the group by clause to group records into max of three records? i.e. there may be more than 3 records belonging to that group in the query but I only want to see the top 3. James.
Hi, Is there a way in the group by clause to group records into max of three records? i.e. there may be more than 3 records belonging to that group in the query but I only want to see the top 3. James.
Mar 19, 2003 #2 swampBoogie Programmer Jan 6, 2003 1,660 SE select * from t q where pkColumn in (select top 3 pkColumn from t where groupingColumn = q.groupingColumnd order by orderColumn ) If that's not what you are looking for, could you be somewhat more specific. I.e. supply some sample data and the expected result. Upvote 0 Downvote
select * from t q where pkColumn in (select top 3 pkColumn from t where groupingColumn = q.groupingColumnd order by orderColumn ) If that's not what you are looking for, could you be somewhat more specific. I.e. supply some sample data and the expected result.
Mar 20, 2003 Thread starter #3 James1981 Programmer Nov 2, 2002 76 US Thanks, this is exactly what i was looking for James Upvote 0 Downvote