On Thu, Sep 17, 2009 at 06:34:39PM +0100, Gavin McCullagh wrote:
> On Thu, 17 Sep 2009, Gavin McCullagh wrote:
>
> > On Thu, 17 Sep 2009, Frank Bax wrote:
> >
> > > Gavin McCullagh wrote:
> > >> SELECT time, to_timestamp(time) AS ts,
> > >> EXTRACT('months',to_timestamp(time)) FROM mdl_log;
> >
Gavin McCullagh wrote:
On Thu, 17 Sep 2009, Frank Bax wrote:
Gavin McCullagh wrote:
SELECT time, to_timestamp(time) AS ts,
EXTRACT('months',to_timestamp(time)) FROM mdl_log;
ERROR: syntax error at or near ","
LINE 1: ...t time, to_timestamp(time) AS ts, extract('months',to_times...
Try repl
On Thu, 17 Sep 2009, Osvaldo Kussama wrote:
> From manual:
> http://www.postgresql.org/docs/current/interactive/functions-datetime.html
>
> date_part('month',to_timestamp(time))
> or
> extract(month from to_timestamp(time))
Gah. I don't know I missed that. This works fine.
SELECT extract(mo
On Thu, 17 Sep 2009, Gavin McCullagh wrote:
> On Thu, 17 Sep 2009, Frank Bax wrote:
>
> > Gavin McCullagh wrote:
> >> SELECT time, to_timestamp(time) AS ts,
> >> EXTRACT('months',to_timestamp(time)) FROM mdl_log;
> >> ERROR: syntax error at or near ","
> >> LINE 1: ...t time, to_timestamp(time)
2009/9/17 Gavin McCullagh :
> On Thu, 17 Sep 2009, Frank Bax wrote:
>
>> Gavin McCullagh wrote:
>>> SELECT time, to_timestamp(time) AS ts,
>>> EXTRACT('months',to_timestamp(time)) FROM mdl_log;
>>> ERROR: syntax error at or near ","
>>> LINE 1: ...t time, to_timestamp(time) AS ts, extract('months'
On Thu, 17 Sep 2009, Frank Bax wrote:
> Gavin McCullagh wrote:
>> SELECT time, to_timestamp(time) AS ts,
>> EXTRACT('months',to_timestamp(time)) FROM mdl_log;
>> ERROR: syntax error at or near ","
>> LINE 1: ...t time, to_timestamp(time) AS ts, extract('months',to_times...
>
> Try replacing extr
Gavin McCullagh wrote:
SELECT time, to_timestamp(time) AS ts, EXTRACT('months',to_timestamp(time))
FROM mdl_log;
ERROR: syntax error at or near ","
LINE 1: ...t time, to_timestamp(time) AS ts, extract('months',to_times...
Try replacing extract('month',value) with extract('months' from value