Ive got query like this:
select distinct UserID, Count(UserId) as MyNumber from dbo.User2User group by UserId
now I would like extend this query to get MIN, MAX and AVG of MyNumber
no idea how to get to this value from another select or sth …
thanks for help
You can use your own query as a subquery :
Note that the DISTINCT keyword isn’t necessary : GROUP BY already selects distinct UserID.