I am searching for the Linq-to-SQL equivalent to this query:
SELECT
[cnt]=COUNT(*),
[colB]=SUM(colB),
[colC]=SUM(colC),
[colD]=SUM(colD)
FROM myTable
This is an aggregate without a group by. I can’t seem to find any way to do this, short of issuing four separate queries (one Count and three Sum). Any ideas?
This is what I found seems like you still have to do a group by…can just use constant:
This produces the following SQL, which is not optimal, but works: