Rui,
You have to add a GROUP BY clause.
Try:
SELECT cod,name,deb,cre,SUM(totdeb-totcre) from tablex GROUP BY cod
HTH
>Hello,
>I need to make a SELECT where i can show the movements and the totals together, like this:
>SELECT cod,name,deb,cre,SUM(totdeb-totcre) from tablex
>
>the TOTDEB-TOTCRE are a SUM and the SUM commmand returns only one record, i dont want that, i want all records, like this:
>
>|cod| name | deb | cre | Sald |
>-------------------------------
>| 1 | aaaa | 10 | 0 | 10 |
>| 2 | aaaa | 0 | 15 | -5 |
>...
>Urgent please, thanks
>Rui Trol
Daniel