Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.19 KB | None | 0 0
  1. SELECT c.CategoryID, CategoryName, COUNT(distinct ProductID) AS '# of Products' FROM categories AS c
  2. INNER JOIN products AS p ON c.CategoryID = p.CategoryID
  3. GROUP BY CategoryID, CategoryName;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement