abhi
abhi

Reputation: 377

How to get last week's data from the previous day in postgressql?

I want to extract data for a week from previous day.
For example:
Today's date : 21-06-2021
I want a week's data from : 13-06-2021 to 20-06-2021
In Postgressql

Upvotes: 0

Views: 54

Answers (1)

Praveen
Praveen

Reputation: 9345

you can try

select * from ur_tbl
where 
  date_clmn >= (CURRENT_DATE - INTERVAL '7 day') and
  date_clmm < CURRENT_DATE

Upvotes: 1

Related Questions