On 27 May 2002, at 22:32, [EMAIL PROTECTED] wrote:

> mysql> SELECT dd,count(*) FROM test GROUP BY dd;
> +----------+----------+
> | dd       | count(*) |
> +----------+----------+
> | 20020527 |        1 |
> | 20020527 |        1 |
> | 20020527 |        1 |
> | 20020527 |        1 |
> +----------+----------+
> 4 rows in set (0.00 sec)

The 8 in timestamp(8) affects only the display.  The other digits are 
still there internally, so the values are still distinct when you 
attempt to group them.  Perhaps what you want is something like

   SELECT LEFT(dd, 8), COUNT(*) GROUP BY LEFT(dd, 8);

Also, if you're not using the automatic-update property of TIMESTAMP, 
you might want to use a DATE or DATETIME column instead.

[Filter fodder: SQL]

-- 
Keith C. Ivey <[EMAIL PROTECTED]>
Tobacco Documents Online
http://tobaccodocuments.org

---------------------------------------------------------------------
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

Reply via email to