>SELECT COUNT(DISTINCT SubCategoryID) FROM Whatever WHERE CategoryID = 123 >It is that I need to get the main category fields such as:
SELECT Category.Numero,MIN(Category.Anglais) AS Anglais,COUNT(Category2.Numero) AS Compte FROM Category LEFT JOIN Category AS Category2 ON Category.Numero=Category2.NoCategory WHERE Category.NoClient=78 AND Category.NoCategory=0 GROUP BY Category.NumeroAnd, I am trying to avoid the GROUP BY which forces me to use MIN() syntax to collect other fields or to use a sub select.