日期:2014-05-20 浏览次数:20650 次
select COUNT(*) as '总数','已占用'= (select COUNT(distinct(graveno)) from d_necro where d_necro.garea='2001') from Graves where FgrId ='2001'
var query=from g in db.Graves where g.FgrId== 2001 select new { 总数=db.Graves.Count(m=>m.FgrId== 2001), 已占用=db.d_necro.Where(n=>n.garea==2001).Select(n=>n.graveno).Distinct().Count() };