Re: Group by with an IF

2006-08-14 Thread Brent Baisley
The problem is your GROUP BY on celec_id. MySQL is doing the grouping and thus only grabbing the first season_week_date value within the grouping. I'm not sure what end result your are looking for. Grouping additionally by season_week_date might be what you are looking for. GROUP BY r.celeb_id,

Re: Group by with an IF

2006-08-13 Thread Chris
Steffan A. Cline wrote: I have the following query: select *, if( season_week_date = "2006-08-16", "on", "off" ) as stat, sum(overall_points) as total_points from rosters r left join celebs c on c.celeb_id = r.celeb_id where season_id=5062 and user_id=1 group by r.celeb_id order by overall