我如何才能显示有预算>的结果? 1000?
SELECT
BP_Year
,BP_UID
,BP_Name
,SUM(BP_Budget) as sumBudget
FROM T_UPS_BudgetPositions
GROUP BY
BP_UID
,BP_Name
,BP_Year
答案 0 :(得分:4)
使用HAVING子句:
SELECT
BP_Year
,BP_UID
,BP_Name
,SUM(BP_Budget) as sumBudget
FROM T_UPS_BudgetPositions
GROUP BY
BP_UID
,BP_Name
,BP_Year
HAVING SUM(BP_Budget) > 1000