a guest Aug 13th, 2017 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- SELECT TXNID,
- FROM ACCOUNTING_BOOK
- WHERE TXNID like 'M003%' ;
- TXNID:M003 TOTAL_AMT:25 ACCOUNT_CATEGORY:Revenue Debit:null Credit:null
- TXNID:M003 TOTAL_AMT:25 ACCOUNT_CATEGORY:Asset Debit:null Credit:null
- update accounting_book11 a_R set DEBIT= CASE WHEN ACCOUNT_CATEGORY IN('Expense','Asset')
- then (SELECT SUM(TOTAL_AMOUNT)
- FROM ACCOUNTING_BOOK11
- WHERE ACCOUNTCATEGORY='Revenue'
- AND TXNID=a_R.TXNID)
- ELSE 0
RAW Paste Data