MYSQL view without using variables -
i want convert query view. need eliminate utilize of variables. sql code this:
set @runningtotal = 0; select feescollected.datepaid, feescollected.termpaidfor, feescollected.feespaid, @runningtotal := @runningtotal + feescollected.feespaid runningtotal feescollected;
expected output:
datepaid termpaidfor feespaid runningtotal ---------------------------------------------------- 2014-02-06 150000 150000 2014-03-24 70000 220000 2014-04-08 80000 300000
like this?
select feescollected.datepaid, feescollected.termpaidfor, feescollected.feespaid, (feescollected.feespaid + 0) runningtotal feescollected;
mysql variables views
No comments:
Post a Comment