此 sql 查询的 linq 查询是什么
SELECT
sum(IIF(jenis = 'primer',1,0)) as sum_primer,
sum(IIF(jenis = 'sekunder',1,0)) as sum_sekunder
FROM cooperations
尝试从 101 个 Linq 样本中搜索相同的示例,但没有任何线索
更新 所以,我在我的 C# 中使用这个查询
var query = (from c in db_cooperations.cooperations
group c by c.jenis into g
select
(new
{
sum_primer = g.Count(c => c.jenis == "primer"),
sum_sekunder = g.Count(c => c.jenis == "sekunder")
})).ToArray();
输出是
sum_primer sum_sekunder
0 0
0 52
250 0
0 0
0 0
那么,我怎样才能删除零值,只返回一行