Quantcast
Channel: Questions in topic: "cte"
Viewing all articles
Browse latest Browse all 75

Summing Counts from Multiple Tables

$
0
0
--Supplier Count SELECT id, COUNT (*) AS cnt FROM atable WHERE id IN ('1','2',3') GROUP BY id ORDER BY id --id Count SELECT id, COUNT (*) AS cnt FROM btable WHERE id IN ('1','2',3') GROUP BY id ORDER BY id How do I add the Count of id's1,2,3 from atable and btable in one piece of code without having to process atable and btable separately then adding the Counts for each supplier in Excel?

Viewing all articles
Browse latest Browse all 75

Trending Articles