SQL中的distinct在sqlsuagr中怎么实现? 返回
SqlSugar
老数据
1
3520
悬赏:5 飞吻
下面这段sql代码怎么转为sqlsugar
Select at1.UserID,
Count(distinct at2.UserID) AgentCnt,
from dbo.AgentTree at1
Left Join dbo.AgentTree at2
on at1.UserID = at2.ParentID
where at1.ParentID = 40012
group by at1.UserID
主要是这个distinct在sqlsugar中怎么实现
热忱回答(1)
-
小小灰帽 VIP0
2018/1/24已经解决,大家不用回答了,谢谢,用SqlFunc.MappingColumn(at2.UserID, "Count(distinct at2.UserID)")就可以了
0 回复