Cheesy Posted April 26, 2011 Share Posted April 26, 2011 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 More sharing options...
birbal Posted April 26, 2011 Share Posted April 26, 2011 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 More sharing options...
Cheesy Posted April 26, 2011 Author Share Posted April 26, 2011 Thanx very much. Worked perfectly Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.