SELECT TOP 1 [InviteId],COUNT(*) AS [COUNT] FROM [dbo].[User] GROUP BY [InviteId] ORDER BY [COUNT] DESC
转 linq to sql 该怎么写?
(from u in User
group u by u.InviteId into ulist
select new {InviteId=ulist.Key,Count = user.Count()})
.FirstOrDefault()