I have a mysql table called 'records' with this structure: docdate, db, cr, total
and two queries like:
1. SELECT docdate, SUM(total) as ins FROM records where db='somefilter' AND 'someotherfilters' GROUP BY docdate
2. SELECT docdate, SUM(total) as outs FROM records where cr='somefilter' GROUP BY docdate
What I want to achive in one sql statement is a result like:
docdate         ins      outs
2015-12-15     NULL   1200.00
2015-12-16  1000.00      NULL
2015-12-17  2500.00   2000.00
Any idea will be highly appreciated. Tnx
 
     
     
     
    