Subject Re: SQL: Number of entries per day
Author tickerboo2002
> select f_dayofmonth(ts), count(*) entries from table1 group by
> f_dayofmonth(ts) having entries>0

Thanks.

Where is the f_dayofmonth function located (or have you just made
that up as an example?)

> not sure if the group by will work on function
> but you even if it does - how do you want the days to be separated
across
> months and years? you surely don't want all 1st's of the month to be
> totalled together?message have been removed]

I was thinking of returning a date and the number of entries on that
day, i.e casting the timestamp using:

CAST(TIME_STAMP as DATE)

I've just tried:

select CAST(ts as date), count(*) as entries
from run_log
group by CAST(ts as date)
having entries > 0

but it complains about the group by entry - 'Unknown toekn CAST'