0

I would like to get the entries for a range of dates, using PostgreSQL.

For example...

beginyear       endyear       name
---------       -------       -----
950             1100          jason
1300            1400          andrew

I would like to get all people who lived in 1050. Could someone please help me to write this query.

2 Answers 2

5
select name
from yourtable
where 1050 between beginyear and endyear;
Sign up to request clarification or add additional context in comments.

Comments

0
SELECT * FROM mytable
 WHERE beginyear <= 1050 AND 1050 <= endyear

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.