Skip to content
Advertisement

postgres unable to get query filter by time and date viz

I have data like this:-

I want result to be filter by time i.e within that date range I want record created between 5 to 7

expected result:-

Advertisement

Answer

Try casting the timestamp column to time and keep your logic.

Using extract(hour ...) is also an alternative, but you lose the ability to consider minutes in your time interval, e.g. 05:42:0006:55:00

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