What Am I Doing Wrong?

Поиск
Список
Период
Сортировка
От Lane Van Ingen
Тема What Am I Doing Wrong?
Дата
Msg-id EKEMKEFLOMKDDLIALABIIEPMCDAA.lvaningen@esncc.com
обсуждение исходный текст
Ответы Re: What Am I Doing Wrong?  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-sql
I have been trying to subtract two timestamps from each other to determine
the difference between the two timestamps (current time and a past timestamp
called 'updated_time') IN SECONDS, but no luck.

The trouble I am having is getting the first timestamp, representing the
current time, to translate to seconds; have tried different commands (now(),
localtimestamp, current_timestamp, etc)

What am I doing wrong? Sample statement and error message is below:
                     ------------------------------------------

select EXTRACT(EPOCH from TIMESTAMP current_timestamp) - EXTRACT(EPOCH from
TIMESTAMP updated_time) ::integer

ERROR:  syntax error at or near "current_timestamp" at character 37




В списке pgsql-sql по дате отправления:

Предыдущее
От: "Lane Van Ingen"
Дата:
Сообщение: Re: What Am I Doing Wrong?
Следующее
От: "Sri"
Дата:
Сообщение: Problem while using start transaction ans commit;