Jump to Post
There may be an easier way, but I think this works:
SELECT `name`, SUM(sm) AS total FROM ((SELECT `name`, kns AS sm FROM tab1) UNION ALL (SELECT `name`, kng AS sm FROM tab2)) AS tbl GROUP BY tbl.name
You may benefit from using an user_id in order to relate your …
All 2 Replies
We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.