我有一个包含多个成本条目的sql表以获得唯一的ID。实体框架选择列的总和大于x的位置
这里是表的简化版本:
Table:
{
public int Id {get;set;}
public DateTime date {get;set;}
public int Cost {get;set;}
}
我需要建立一个EF查询,做到以下几点:
select from the table where x.date.Date = DateTime.Now.date && SUM(x.cost) > 100.00)
and it should group by x.Id
你是如何分组数据?或者你的意思是“哪里成本> 100”? – DavidG
非常有效的一点,我完全忘了把这个添加到我的问题中。我现在添加了它。 – Zapnologica