I have 2 tables.
I am trying to get this result
Im having trouble with this query, the quantities seem t0o large, this is what i have and its wrong. I want the items-title and group to concat if they are in the same row, and the qtys to be summed up. Thank you.
SELECT g.`groupname`, SUM(i.`qty`) as qty
FROM `items` AS i
INNER JOIN `groups` AS g
WHERE i.`groupid` = g.`groupid` OR i.`rownum` > 0
GROUP BY g.`rownum`
Edit:
This may help if i've not explained correctly