請試試看這樣 select count(CASE WHEN move BETWEEN -10000 AND -200 THEN 1 END) as count_...
SELECT (SELECT COUNT(`move`) FROM `[table_name]` WHERE `move` <= -200) AS '-2...
先利用一下暫時欄位建立完成後。再依暫存欄位來做GROUP處理例子 SELECT keyGroup,count(*) AS num FROM ( SELE...
突發奇想,把條件定義在 mapping table 中 !環境:SQL Server 2019 DECLARE @data TABLE...