List:General Discussion« Previous MessageNext Message »
From:Christian Mack Date:July 17 1999 3:46pm
Subject:Re: want to sort according to timestap(14), with date not time.
View as plain text  
Saku Ytti wrote:
> 
> I have timestamp(14) variable, let's call it bar, table shall be foo.
> I'd like to sort according to date, not whole timestamp, so that
> year/month/day match. And only display each date once, and report
> how many matches there were, sorted. Something like:
> 
> select *, count(*) from foo group by bar;
> How to implement order? I only managed to get syntaxt error.
> 
> --
>         --ytti - ::3585:0512:1378

Hi Ytti

Use somthing like:
SELECT
	DATE_FORMAT( bar, '%Y%m%d' ) as Date
	, COUNT(*)
FROM
	foo
GROUP BY
	Date

Tschau
Christian

PS: Sorry for the late answer, I was on vacation.

Thread
want to sort according to timestap(14), with date not time.Saku Ytti12 Jul
  • Re: want to sort according to timestap(14), with date not time.Christian Mack17 Jul