I have this request that I use because naive GROUP BYgives an exceeded resource. Documents say what TOPshould be used for this case.
SELECT TOP(col), COUNT(distinct(othercol)) FROM [table]
When I run this, I get an error message saying that I can only use COUNT(*)as it says in the docs.
Error: Only COUNT(*) and MAXCOUNT(*) are allowed with TOP(). Use TOP_COUNT or TOP_MAXCOUNT instead., TOP() must be accompanied by COUNT(*). Try TOP_COUNT or TOP_MAXCOUNT instead.
The question is, what TOP_COUNTand TOP_MAXCOUNT? They are not documented anywhere.
source
share