转成sqlsugar 返回
SqlSugar
处理完成
1
274
《%》 发布于1个月前
悬赏:0 飞吻
SELECT * FROM [dbo].[DetectionRecode] AS d JOIN [dbo].[DetectionOrder] AS o ON d.OrderNo = o.OrderNo JOIN ( SELECT o2.CustomerId, o2.PatientName, d2.DetectionProjectId, COUNT(DISTINCT o2.OrderSource) AS CountDistinctOrderSource FROM [dbo].[DetectionRecode] AS d2 JOIN [dbo].[DetectionOrder] AS o2 ON d2.OrderNo = o2.OrderNo GROUP BY o2.CustomerId, o2.PatientName, d2.DetectionProjectId HAVING COUNT(DISTINCT o2.OrderSource) > 1 ) AS SubQuery ON o.CustomerId = SubQuery.CustomerId AND o.PatientName = SubQuery.PatientName AND d.DetectionProjectId = SubQuery.DetectionProjectId
这个用sqlsugar语句(ISugarQueryable)怎么表达
热忱回答(1)
-
fate sta VIP01个月前
看文档 :分组 、 嵌套查询 、联表查询
0 回复