i want this
name | Total Qty | Total Cost(sumQuantity) | total price(sum Quantity)
Item table
Name | item_id | Cost price | Unit price |
shirt1 | 4 | 3800.00 | 5320.00
shirt2 | 5 | 3800.00 | 5320.00
shirt3 | 6 | 3800.00 | 5320.00
shirt5 | 7 | 2900.00 | 4060.00
-----------------------------------------------
quantities table
item_id | Quantity
4 | 5
5 | 4
6 | 3
7 | 1
please guys help me… Any help appreciated!
Something like the following?
SELECT Name, Quantity, (Quantity * CostPrice) AS Total_Cost, (Quantity * UnitPrice) AS Total_Price FROM Item LEFT JOIN Quantities ON Item.item_id = Quantities.item_id
where is sum? total amount?
What have you tried? We need to see what you’ve tried before we can help you do your homework. We’re not going to do it for you.
r937
May 8, 2015, 5:03pm
5
okay, this will help…
you need an INNER JOIN
you need GROUP BY
and you need SUM() functions
**Guys Help me >
Less Sale at Cost price
what will be mysql Query any idea???**
r937
May 9, 2015, 12:23am
8
sure, i have an idea…
you need an INNER JOIN
you need GROUP BY
and you need SUM() functions
1 Like
system
Closed
August 8, 2015, 7:31am
9
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.