Re: extracting from epoch values in pgsql
| От | Gavin McCullagh |
|---|---|
| Тема | Re: extracting from epoch values in pgsql |
| Дата | |
| Msg-id | 20090917173439.GW16815@gcd.ie обсуждение исходный текст |
| Ответ на | Re: extracting from epoch values in pgsql (Gavin McCullagh <gavin.mccullagh@gcd.ie>) |
| Ответы |
Re: extracting from epoch values in pgsql
|
| Список | pgsql-sql |
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) AS ts, extract('months',to_times...
> >
> > Try replacing extract('month',value) with extract('months' from value)
>
> Makes no difference whether month or months:
Actually, I pasted a different query, but based on the one in my last
email:
moodle-01-01-2009=# SELECT EXTRACT('months',(TIMESTAMP WITH TIME ZONE 'epoch' + mdl_log.time * INTERVAL '1 second'))
FROM mdl_log;
ERROR: syntax error at or near ","
LINE 1: SELECT EXTRACT('months',(TIMESTAMP WITH TIME ZONE 'epoch' + ... ^
moodle-01-01-2009=# SELECT EXTRACT('month',(TIMESTAMP WITH TIME ZONE 'epoch' + mdl_log.time * INTERVAL '1 second'))
FROM mdl_log;
ERROR: syntax error at or near ","
LINE 1: SELECT EXTRACT('month',(TIMESTAMP WITH TIME ZONE 'epoch' + m... ^
Gavin
В списке pgsql-sql по дате отправления: