Answer the question
In order to leave comments, you need to log in
How to get data from 2021-01-01 to 2020-01-01 inclusive from the database?
I have a date column where the timestamp is stored, I want to get data from 2021-01-01 to 2020-01-01 inclusive, how can I do this?
Tried something like this but it gives wrong result
SELECT COUNT(*) FROM tableee where date > (CURRENT_DATE - INTERVAL '3 months') - INTERVAL '7 months';
Answer the question
In order to leave comments, you need to log in
SELECT * FROM table t WHERE t.date BETWEEN '2020-01-01 00:00:00' AND '2021-01-01 23:59:59'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question