我想按日期降序列出我的客户订单的最后付款。
我写了一个sql查询
SELECT CARHARTAR,
CARHARREFNO,
CARHARCARKOD,
CARHARCARUNVAN,
CARHARACIKLAMA,
CARHARTUTAR
FROM CARHAR
WHERE ( CARHARTIPI IN ( 2, 4 ) )
AND ( CARHARISTIPNO IN ( 2, 6 ) )
AND ( CARHARCARKOD NOT LIKE 'W%' )
AND ( CARHARCARKOD NOT LIKE 'Z%' )
AND ( CARHARGCFLAG = 2 )
AND ( CARHARIADEFLAG = 0 )
ORDER BY CARHARTAR DESC
此查询按日期降序列出所有付款顺序。但我只需要最后一次付款。我正在使用 carharcarkod 组,但我有一个聚合功能问题。我应该怎么办 ?