Skip to content
Advertisement

Tag: cobol

DB2 SQL query to SUM the column and Subtract column

I have TRAN_AM (Transaction amount) and DB_CRD_ID(Debit Credit ind). I have to SUM the TRAN_AM based on the credit debit indicator in a single query. Input: My output should be 10, D. Also have to manage negative if Credit is higher. This query will be used as subquery, As I have to compare this amount with the another table. Thanks

Advertisement