> Your message cannot be posted because it appears to be either spam or
> simply off topic to our filter. To bypass the filter you must include
> one of the following words in your message:

> sql,query

> If you just reply to this message, and include the entire text of it in the
> reply, your reply will go through. However, you should
> first review the text of the message to make sure it has something to do
> with MySQL. Just typing the word MySQL once will be sufficient, for example.

> You have written the following:

> Hi,

>> Field1 (varchar) , Field 2 (timestamp) .
>> I want to do :
>> select count(*) , field1 , group by field1 .
>> That's ok , but i'd like to get results like :
>> 2002-01-01 3
>> 2002-01-02 4
>> .....
>> How can i do that considering the timestamp field which stores date like
>> (20020314184748) , thus
>> containg the hour , second , etc ?

Try something like:

  select substring(field2, 1, 8), count(*)
  from yourtable
  group by substring(field2, 1, 8);


Regards,
Sasa



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