SELECT *
FROM mytable
WHERE (start_date, end_date) OVERLAPS ('2012-01-01'::DATE, '2012-04-12'::DATE);
Datetime functions is the relevant section in the docs.
More Related Contents:
- Find overlapping date ranges in PostgreSQL
- How do you do date math that ignores the year?
- Getting date list in a range in PostgreSQL
- PostgreSQL: how to convert from Unix epoch to date?
- Check whether string is a date Postgresql
- How to compare dates in datetime fields in Postgresql?
- Postgresql query between date ranges
- Query for count of distinct values in a rolling date range
- How to return only the Date from a SQL Server DateTime datatype
- Computed / calculated / virtual / derived columns in PostgreSQL
- Insert data in 3 tables at a time using Postgres
- What is the difference between single quotes and double quotes in PostgreSQL?
- Simulate CREATE DATABASE IF NOT EXISTS for PostgreSQL?
- PostgreSQL: Which Datatype should be used for Currency?
- Best way to count rows by arbitrary time intervals
- PostgreSQL sequence based on another column
- Finding similar strings with PostgreSQL quickly
- Select data from date range between two dates
- Sort NULL values to the end of a table
- How to compare the current row with next and previous row in PostgreSQL?
- Window Functions or Common Table Expressions: count previous rows within range
- Continuing a transaction after primary key violation error
- Select (retrieve) all records from multiple schemas using Postgres
- Optimize groupwise maximum query
- Use email address as primary key?
- PostgreSQL – fetch the rows which have the Max value for a column in each GROUP BY group
- SQL query to find record with ID not in another table
- Get execution time of PostgreSQL query
- Postgresql tables exists, but getting “relation does not exist” when querying
- Why isn’t row level security enabled for Postgres views?