On 2/3/2012 12:45 PM, rixtertrader wrote:
Igor Tandetnik wrote:
It could be written more explicitly:

GROUP BY Year + (case WeekNum when 53 then 1 else 0 end),
     (case WeekNum when 53 then 1 else WeekNum end);

Okay, I get it. GROUP by Year and if week 53 it becomes part of the next
Year. GROUP by WeekNum and if 53 it becomes 1.

Does this effect the Max(High) and Max(Low) values as well? In other words,
will the values of week 53 be part of the equation with week 1 when
returning Max(High) and Max(Low) for the week?

Yes. All rows for which expressions in the GROUP BY clause evalulate to the same values end up in the same group. Aggregate functions then work on that group.
--
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to