i have two tables first one name is \"sales\" and second one name is \"items\" in both tables have same columns \"code\" and \" qtd \"; i want write MYSQL query witch i need sum
Try this:
Select code, sum(qtd) from ( select code, qtd from sales union all select code, qtd from items) as innerTable group by code