Reputation: 55
I have two tables in MySql:
and_fakture field:id, organizatorId,...
ukupno is numeric
How can i sum(ukupno) from organizatorId ?
Upvotes: 0
Views: 24
Reputation: 2916
Your question is not very clear, but you want something like this?:
SELECT organizatorId, SUM(ukupno)
FROM and_fakture
INNER JOIN and_stavke ON and_fakture.id = and_stavke.idFakture
GROUP BY organizatorId
This will give you the sum of ukupno by every organizatorId
Upvotes: 1