0
你能幫我這個MySQL翻譯成Linq的請:LINQ Case語句與COUNT和GROUP
SELECT distcode, COUNT(cid) as count_all_case
,count(case when labid = 1 then cid end) as count_id1
,count(case when labid = 2 then cid end) as count_id2
,count(case when labid = 3 then cid end) as count_id3
FROM labcase
WHERE SEQ is not NULL AND date_serv BETWEEN 20160101 AND 20161001
GROUP BY distcode
感謝
應該在where子句不labCase.date_serv日期條款?最有可能只是一個錯字 –
@Ctrl_Alt_Defeat:是的,固定的。 –