首页新闻找找看学习计划

求此sql转成linq写法??

0
悬赏园豆:10 [已解决问题] 解决于 2015-03-09 14:47

select t.opinion,t.node,t.result,d.flow_state,t.data_id, count(t.create_user)
from OMT_DEFECT_FLOW t inner join OMT_DEFECT_DETAIL d on d.id=t.data_id
group by d.flow_state,t.opinion,t.node,t.result,t.data_id having t.data_id='4c51493f-0751-4614-a462-35ed6ec169d0'
and d.flow_state='S030'

renshen4322的主页 renshen4322 | 初学一级 | 园豆:5
提问于:2015-02-03 14:54
< >
分享
最佳答案
0

from t in OMT_DEFECT_FLOW join p in OMT_DEFECT_DETAIL on t.data_id =p.id group by ... ... select t

收获园豆:10
_Vegetables | 小虾三级 |园豆:569 | 2015-02-03 17:26

这样不行!

renshen4322 | 园豆:5 (初学一级) | 2015-02-03 18:50

@renshen4322: 

var q = from ct in Cd.Classifytb
                    join lt in Ld.Logtb
                    on ct.Id equals lt.Cid
                    group ct.Id by ct.Name1 into g
                    select new
                    {
                        g.Key,
                        cnt = g.Sum()
                    };
            ViewData["classifylist"] = q.ToList();

renshen4322 | 园豆:5 (初学一级) | 2015-02-04 00:01
其他回答(1)
0

............................定

【秦时明月】 | 园豆:803 (小虾三级) | 2015-02-03 15:00

你想表达什么?

支持(0) 反对(0) renshen4322 | 园豆:5 (初学一级) | 2015-02-03 18:47
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册