Mysql - How to sum two intervals, How to sum two intervals in mysql
How to sum two intervals
By using case statement in mysql you can pass the conditions to get sum of different intervalsFinding sum of difference between two intervals
select name,email,uid, sum(case when (paymentDate between \'2012-12-01\' and \'2013-06-06\') then paid else 0 end) paid1, sum(case when (paymentDate between \'2011-12-01\' and \'2012-06-06\') then paid else 0 end) paid2 from transaction,user where user.id=transaction.uid and transaction.paid>0 and email like \'%%\' and name like \'%%\' group by uid order by paid1,paid2
The topic on Mysql - How to sum two intervals is posted by - Maha
Hope you have enjoyed, Mysql - How to sum two intervalsThanks for your time