Complex Select Statement
Posted on 2011-03-03
I an trying to assemble a query that does the following in psudo code but in a single query without using a temp table. I'm not sure how to do it. Can someone help?
SELECT Distinct UserID
Start Loop of results from query 1)
SELECT count(*) as RecordCount
WHERE UserID = UserID (from query 1)
End Loop of results from query 1)
I put all the results of query 2 into a temp table.
Then I query the temp table as follows.
ORDER BY RecordCount desc
Display Top 10
Thanks in advance.