SQL查询提示:ORA 00904:"ROW_NUM":标识符无效
SELECT T.LOT_ID, T.PRODUCT_ID,T.ROUTE_ID,T.OPERATION_ID,
T.TRANS_TIMESTAMP,T.TRANS_OPERATOR,T.TRANS_QTY1,
LM.CREATE_CATEGORY,LM.LOT_TYPE,
LM.LOT_OWNER,LM.HOT_FLAG||'-'||LM.LOT_PRIORITY LOT_PRIORITY,
LM.DUE_DATE,T.STAGE_ID,
LM.CUSTOMER_NAME,
NVL(T.REASON_CODE_DESC,T.REASON_CODE) REASON_CODE,T.REASON,PM.PRODUCT_TYPE,PM.PRODUCT_GROUP_DESC,
REGEXP_SUBSTR(T.REASON,'[^ ]+',1,2) DEPT_PART,
row_number() over(partition by t.lot_id order by t.trans_timestamp desc) row_num
FROM LOT_SCRAP_UNSCRAP_SUMM T, LOT_MASTER LM,SHIFT_MASTER DM,PRODUCT_MASTER PM
WHERE T.LOT_RRN=LM.LOT_RRN
AND T.PRODUCT_RRN=PM.PRODUCT_RRN
AND T.TRANS_TIMESTAMP>=DM.START_DATE
AND T.TRANS_TIMESTAMP<DM.END_DATE
AND LM.LOT_TYPE<>'IT'
and row_num=1
ORDER BY TRANS_TIMESTAMP
SQL查询报表信息 ,row_number 语句定义新曾列ROW_NUM一项, where条件查询该列为1的结果,
提示报错:ORA 00904:"ROW_NUM":标识符无效
请高人指点迷津。