Skip to content
Advertisement

SQL – to query record that created after latest specific time

I currently have a database which have the created as a timestamp of each record that it was created.

I try to query all the data that was created after the latest midday time (12:00).

So, let’s said data is

And current time is 3rd Oct 11.59, I would like answer of query to be

But if the data is

And current time is 3rd Oct 13.00, I would like answer of query to be

What is the best query should be? I running the DB on postgresql.

Thanks and appreciated all help.

Advertisement

Answer

You can use date arithmetic:

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement