List:General Discussion« Previous MessageNext Message »
From:Phil Glatz Date:April 29 1999 8:57pm
Subject:group by week()
View as plain text  
for is a table with a series of row, one per day
when is a timedate field

select when,week(when) as wk from foo group by wk order by when;

This query does group properly on week numbers, but the date in the 'when'
column is a value from sometime within the week, but not necessarily the
starting day of the week - any way to make this column reflect the first
day of the week?

group by week()Phil Glatz30 Apr
  • group by week()Michael Widenius30 Apr