Jump to content

Select Top 5


Cheesy

Recommended Posts

Hi, I have a table with about 1000+ records of horse sales by different sellers (they repeat over time, and there are too many to individually select). The problem i have is that i need to add up the total of what each seller made off selling all of their horses and then select the top 5 sellers who made the most. I know how to select the top 5 i just don't know how to add up the totals. Any help would be much appreciated. Thanx

Link to comment
Share on other sites

You need to use SUM() aggregate function in 'price' column and then you need to GROUP BY in 'seller' column

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...