|
-
November 30th, 2004, 02:00 AM
#1
about calculating the top ten
i get a transaction table with sub_quantity, bookid, and a book table with bookid...etc
i want to get the top ten books by adding up the sub_quantity of each book.
say there are 3 transactions
1 ASP 10 (quantity)
2 PHP 10
3 ASP 10
4 MYSQL 4
5 PHP 6
i write to show the ranking of the sold book.....by writing
SELECT b.name from book as b, transaction as t order by t.sub_quantity desc limit 10;
the query gets a problem of not adding up the price to rank...and so the result is the one i want....
can anyone tell me how to edit this query?
thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|