I have a table name receipt the scema is as follow
account_no date transaction_type amount s1 2012-7-7 opening 500 s1 2012-8-13 deposit 1000 s1 2012-7-17 deposit 400
Now I have the following query
select month(r.date), sum(case when (month(r.date))='7' and r.transaction_type='opening' and r.transaction_type='deposit' then r.amount else '' end )as debit from receipt r where r.account_no='s1'
But it is giving me output as:
month debit 7 0
can any one tell me why it is giving me this output ?
if i want to place the name of month instead of number then how to do that</div