nemesis_256
11-10-2009, 11:25 AM
I'm not sure if this is possible. I'm creating a contest platform, and people will be entering every day, but prizes are only given away during week days. Now I'm building an admin so someone will randomly pick a winner for each day. In the admin I do not want Saturdays and Sundays to show up, but I want the number of people who entered on those days to show up on Monday.
Here's my current query:
select dateAdded, count(option1) as option1, count(option2) as option2, count(option3) as option3, count(option1) + count(option2) + count(option3) as total, group_concat(winner separator '|') as winner from users group by dateAdded order by dateAdded desc
People will have 3 ways to enter, so that's what the option1 through 3 columns are. The group_concat is for the possibility of having multiple winners per day, to display them.
Now with "gorup by dateAdded", Saturday and Sundays would be their own days. How can I combine them into one row with the data from Monday?
Here's my current query:
select dateAdded, count(option1) as option1, count(option2) as option2, count(option3) as option3, count(option1) + count(option2) + count(option3) as total, group_concat(winner separator '|') as winner from users group by dateAdded order by dateAdded desc
People will have 3 ways to enter, so that's what the option1 through 3 columns are. The group_concat is for the possibility of having multiple winners per day, to display them.
Now with "gorup by dateAdded", Saturday and Sundays would be their own days. How can I combine them into one row with the data from Monday?