On 22-Aug-2001 Johan Nilsson wrote:
>>> Is it possible for me to do a SELECT COUNT(*) and GROUP BY the
>>answers based
>>> on a INTERVAL e.g. HOUR?
>>>
<snip>
>>
>>SELECT HOUR(time) as hour,count(*) as cnt FROM foo GROUP BY hour;
>>
>
> Thanks, but I wrote a bad test data =(
>
> +-----------------------+
>| id | dateTime |
> +-----------------------+
>| 1 | 2000-01-01 08:30 | <- i.e. 2000
>| 2 | 2000-01-01 08:31 | <- i.e. 2000
>| 3 | 2001-01-01 08:30 |
SELECT LEFT(dateTime,13) as dayh, ....
Regards,
--
Don Read [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.
(53kr33t w0rdz: sql table query)
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php