8,497
社区成员
发帖
与我相关
我的任务
分享
var Query=from tb in (表.Where(t=>(t.字段b==5 && t.字段c == xx) || t.字段d==v).Distinct().Select(t=>t.字段a))
group tb by t.字段a into g
select new {count=g.Count(s=>s.字段a)};
var Query=表.Where(t=>(t.字段b==5 && t.字段c == xx) || t.字段d==v).Distinct().count();
//select count(字段a) from A where(字段b = 5 and 字段c = xx)or 字段d=v ) A group by 字段a
var query = from A in db.AA
where (A.字段b == 5 && A.字段c == "xx") || A.字段d == "v"
group A by A.字段a into g
select g.Count();
//你的 是字符串类型,转换一下。
sum3 = Convert.ToInt32(a.Field<string>("合計 (水面)")) + Convert.ToInt32(a.Field<string>("F104"))+ Convert.ToInt32(a.Field<string>("F105") + a.Field<string>("F107")),