Reputation: 1895
I want to make a SQL select-query to select everything, but when the client
, thickness
and material
are the same their value of 'amount' should be added.
How would I go about creating such a query?
Upvotes: 0
Views: 1078
Reputation: 2265
if same column then
SELECT
SUM(amount) AS Total
FROM
Tablename
GROUP BY
client,
thickness,
material
Upvotes: 1
Reputation: 31239
If I understand you correctly. You could do something like this:
SELECT
client,
thickness,
material,
SUM(amount) AS TotalAmount
FROM
Table1
GROUP BY
client,
thickness,
material
Upvotes: 6