尝试执行我的语句时,我不断收到错误,说如下:
ERROR [42703] [IBM][DB2/LINUXX8664] SQL0206N "HAO" is not valid in the context where it is used.
错误指的是我的过滤器,因为它在注释掉时可以正常工作。见下文:
SELECT
ROUND(MINUTESDIFF(CURRENT_DATE,LAST_ACTION_DATE)/60,2) AS HAO
FROM [database]
WHERE 1=1
AND QTY > 0
AND STATE = 'Active'
AND HAO > 5
ORDER BY ONHOLD DESC
你不能使用像“HAO”这样的别名作为过滤器吗?我想我以前看过它,所以我一定做错了什么,请告诉我,谢谢!