I have a very complicated SQL query that returns a few hundred results broken down as follows:
user 1 id: ## stuff
user 1 id: ## stuff
user 1 id: ## stuff
....
user 2 id: ### stuff
user 2 id: ### stuff
user 2 id: ### stuff
....
for about 6 users. It's already sorted exactly the way I want, I just want the first 5 for each user. Is there an easy way to do this? I'm using PostgreSQL 8.4 btw, and my SQL knowledge is limited so try to make any explanations not too complicated if possible :D