我使用以下查询但发生错误
无效的列名钱
select * from (SELECT ROW_NUMBER() OVER (order by money desc) as row,
ChargeLog.customerCode,(select taraz from getCustomerMoney(ChargeLog.customerCode)) as money
from ChargeLog
)tblTemp
WHERE row between (1 - 1) * 20 + 1 AND 1*20
答案 0 :(得分:1)
试试这个:
WITH T AS
( SELECT ChargeLog.customerCode,
(select taraz from getCustomerMoney(ChargeLog.customerCode)) as money
from ChargeLog
), T2 AS
(
SELECT ROW_NUMBER() OVER (order by money desc) as row,
customerCode,
Money
FROM T
)
SELECT * FROM T2 WHERE row between (1 - 1) * 20 + 1 AND 1*20