php - MYSQL UNION : returning output of two columns. Need in rows -


i 2 outputs following

image of sql file get

i need

*---------------* | cram  |  dbam | |---------------| |10000  |  1020 | *---------------* 

query

select sum(netamount) 'cram' account typee = 'credit' union select sum(amount + scharge) 'dbam' account typee = 'debit' order `cram` 

you can use case:

    select          sum(case when typee = 'credit' netamount else null end) cram,         sum(case when typee = 'debit' (amount + scharge) else null end) dbam         account  

Comments

Popular posts from this blog

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -