PostgreSQL: How to return rows with respect to a found row (relative results)?

前端 未结 3 1472
情书的邮戳
情书的邮戳 2021-01-24 08:14

Forgive my example if it does not make sense. I\'m going to try with a simplified one to encourage more participation.

Consider a table like the following:

3条回答
  •  無奈伤痛
    2021-01-24 08:30

    You could use something like that:

    select * from foo 
    where dt between now()- interval '7 months' and now()+ interval '3 months'
    

    This and this may help you.

提交回复
热议问题