I want to list last payments of my customers order by date descending.

I wrote a sql query

```
 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 

```

This query list all payments order by date descending. But i only need last payment. I'm using group by carharcarkod but i have an aggreate function problem. What should i do ?

[Here is a screenshot of query result](http://i.stack.imgur.com/hG7tj.jpg)