I am working on a Classifieds website, and I have a question about retrieving search results.
My goal is to display the number of classifieds in each category next to the category-names.
I would prefer to have one query for this need.
Assuming you have a Categories table and a no of classifieds say products you should be able to do something like this:
Select C.Category, Count(P.Id) as ProductsCount From Categories C left join Products P on C.Id = P.Category_Id Group by C.Category Order by C.Category