我可以对分配的变量“YRSUMGTHAN75”进行案例比较吗?当我尝试这样做时,case statement
它对我说“'>'附近的语法不正确”。
这是我的 SQL:
SELECT A.DUR, A.TL_QUANTITY,
(SELECT SUM(TL_QUANTITY) FROM PS_TL_RPTD_TIME
WHERE DUR BETWEEN '01-01-2013' AND '12-31-2013' AND EMPLID = A.EMPLID AND TRC IN ('JNC', 'SRJ')
HAVING SUM(TL_QUANTITY) > 75) AS YRSUMGTHAN75
CASE YRSUMGTHAN75 WHEN > 75 THEN 'NewValue'
End
FROM PS_TL_RPTD_TIME A WHERE A.EMPLID = '10000106052' AND A.DUR > '01-01-2013'