A
A
Alexander Sobolev2018-08-17 11:44:43
PostgreSQL
Alexander Sobolev, 2018-08-17 11:44:43

PostgreSQL How to compare time?

Hello!
I encountered PostgreSQL for the first time .. help me make a query with time comparison:
There is a table cc_files with a lptime field (Format 2018-01-01 00:00:00).
How to write a query like: SELECT * from cc_files WHERE lptime < Current time minus interval variable (for example $t=1 HOUR )
I'm completely confused

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Melkij, 2018-08-17
@san_jorich

Almost literally, this is what it says:

SELECT * from cc_files WHERE lptime < now() - interval '1 hour'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question