Forum Discussion
Greg_Deckler
5 years agoCommunity Champion
How to Get Your Question Answered Quickly
Ever wonder why some questions get answered so quickly while others languish or are seemingly completely ignored? Fear not, this article will help guide you into getting your question answered quickl...
Tummalapati_95
3 months agoFrequent Visitor
Hi Rakesh,
You can achieve this output by a UNION ALL followed by a GROUP BY on the age bucket.
SELECT
Age,
SUM(ID) AS ID
FROM (
SELECT Age, ID FROM Table1
UNION ALL
SELECT Age, ID FROM Table2
) AS Combined
GROUP BY Age
ORDER BY CAST(LEFT(Age, CHARINDEX('-', Age) - 1) AS INT);
Let me know how it went?
Thanks,
Praveen
FayazAhmad
2 months agoFrequent Visitor
- The data days is pretty awesome for me because I learned a lot of things from here ♥️