【发布时间】:2023-03-19 08:38:02
【问题描述】:
我需要在 ef core 中做这个查询:
count(cmt.CaptureMethodId) as Total,
sum(case when DeactivateDate is null then 1 else 0 end) as Active,
sum(case when DeactivateDate is not null then 1 else 0 end) as Inactive
from [dbo].[CaptureMethodTerminals] cmt
join [dbo].[MerchantCaptureMethod] mcm
on cmt.CaptureMethodId = mcm.CaptureMethodId
where mcm.ClientMerchantId in ('00020', '00025')
【问题讨论】:
-
这能回答你的问题吗? SUM and COUNT in single LINQ to SQL query
标签: c# sql entity-framework-core ef-core-2.0