0

I have a table in Postgres database "logs" which holds the error logs with their creation date

sample query : Select creation_date from logs

returns

"2011-09-20 11:27:34.836"
"2011-09-20 11:27:49.799"
"2011-09-20 11:28:04.799"
"2011-09-20 11:28:19.802"

I can find out the latest error using the command

SELECT max(creation_date) from log;

which will return "2012-02-06 12:19:28.448"

Now what I am looking for a query which could return the errors occured in last 15 minutes.

Any help on this will be appreciated

1 Answer 1

2

This should do the trick:

SELECT * FROM logs WHERE creation_date >= NOW() - INTERVAL '15 minutes'
0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.