consider a table: Foodpoll
the structure is as given below:
Column Type
1 vote_date date
2 food_id varchar(10)
3 food_count int(10)
How can i write a query that ll return the following results:
WEEk1
highest votes------------------------------------------------>lowest votes
day1 -food_id1(7), food_id5(5),food_id11(2),food_id17(1)
day2-food_id1(5),food_id4(5),food_id10(3),food_id17(1)
day3-...
day4-..
day5-..
day6-..
day7-..
WEEK2
highest votes------------------------------------------------>lowest votes
day1 -food_id5(17), food_id8(9),food_id11(6),food_id16(2)
day2-food_id2(8),food_id4(3),food_id10(3),food_id17(1)
day3-...
day4-..
day5-..
day6-..
day7-
week3
.
.
.
The main requirement here is,a bunch of boarding school kids should be able to vote for their favourate item everyday,
The results of the foodpoll should be available to the warden on weekly basis,the demand of the items voted on a particular day must also be shown as in the example above