Welcome Guest, Not a member yet? Register   Sign In
Arranging by months_total query
#1

hello , in my senario, students can make entries in the database whole year round entering the number of cash they spent on diferent items.

basically the table is like this

id,timestamp,username,itembought,price

and some sample data is

2, 2014-01-20 13:55:31 , raj, piza, 50
3, 2014-01-21 14:53:32 , raj, juice, 10
4, 2014-01-21 11:52:33 , rita, rice, 150
5, 2014-02-21 11:51:34 , raj, noodle, 250

.
.
.

5000, 2015-01-12 17:50:38 , rani, fish, 40

now i need a yearly report for each student per months(total)

something like this

2014
        january   february    ... december   total
raj     150     100                   100                   2500
rita     150    200                   28                       3000
rani    100  200                     200                  2580    

how can i write my query to get this ? or any suggestion to achive this?
Reply


Messages In This Thread
Arranging by months_total query - by rajneeshgobin - 01-20-2015, 04:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB