Select Category, Books.ISBN,
Orderitems.Quantity * (Books.Retail - Books.Cost) AS Category_Profit
From BOoks
INNER JOIN Orderitems
ON BOOKS.ISBN=ORDERITEMS.ISBN
Example output:
Category ISBN Category_Profit
Family life 1234 50
Family Life 1234 50
Family Life 1234 100
Fitness 4321 10
Fitness 4321 20
So forth and so forth,
How can I make the output calculate all the values for each category into one line?
I.e
Family Life 1234 200
Fitness 4321 30