Sample Table
--------------------------------------------------------------------
S.No | Date | Amount
--------------------------------------------------------------------
1 | 20/10/2015;26/10/2015 | 5000;2000
--------------------------------------------------------------------
2 | 15/10/2015;25/10/2015 | 1500;6000
--------------------------------------------------------------------
How to Split Date
and Amount
and sum of total amount using mysql?
Example
select *,SPLIT_STR(date, ' ', 1) as split_date,
SPLIT_STR(amount, ' ', 1) as split_amount , sum(split_amount)
from
bill_table having str_to_date(split_date,'%d/%m/%Y') <=20/10/2015'
Actually i am expecting the ouptput:
20/10/2015 = 5000
26/10/2015 = 2000
15/10/2015 = 1500
25/10/2015 = 6000
Condition <20/10/2015 So (5000+1500) = 6500
Please help me to solve this problem.
Split Value (Array) & Adding sum of them