Results 1 to 6 of 6
Nov 6, 2012, 05:43 #1
- Join Date
- May 2011
- 1 Post(s)
- 0 Thread(s)
Getting the total quantity of each item in a table
I am working in an online website for selling books.
There is a table where the sold books are stored, like this:
id | int - autoincrement
CustomerID (foreing key to table Customers)
BookID (foreign key to table Books)
How can I calculate the total quantity of sold books of each one?
For instance, having 'n' books, how many BookID = 1 to n have been sold (how many of each one)?
Thanks a lot!!!