Vikram
2013-03-04 22:43:08 UTC
The below query is working perfectly.
SELECT count(Comments.postingID) AS post,Comments.categoryID FROM Comments INNER JOIN Categories ON Comments.categoryID = Categories.categoryID GROUP BY Comments.categoryID
But, once I add, Categories.categoryTitle, leads to an error.In aggregate and grouping expressions, the SELECT clause can contain only aggregates and grouping expressions. [ Select clause = Categories,categoryTitle ]
SELECT Categories.categoryTitle, count(Comments.postingID) AS post,Comments.categoryID FROM Comments INNER JOIN Categories ON Comments.categoryID = Categories.categoryID GROUP BY Comments.categoryID
Please help me out.
Thanks