我想获得每个月的计数,但计数应该每天最多只有一个,即使有多次出现。我的 SQL 查询可以正常工作,但无法将其转换为 LINQ -
select
count(DISTINCT DAY(date)) as Monthly_Count,
MONTH(date) as Month,
YEAR(date)
from
activity
where
id=@id
group by
YEAR(date),
MONTH(date)
谁能帮我把上面的查询翻译成 LINQ。谢谢!