Get Multiple Records Within Date Range Between Two Dates I have the following table :

ID    Title  Value   StartDate      EndDate
=========================================
1      t1     10     10-01-2019   15-01-2019
2      t2     20     15-01-2019   20-01-2019
3      t2     20     20-01-2019   25-01-2019


If I pass 01-01-2019 and 30-01-2019, I expect the following has output.

Output Expected:

1      t1     10     10-01-2019   15-01-2019
2      t2     20     15-01-2019   20-01-2019
3      t2     20     20-01-2019   25-01-2019
You can use the  overlaps operator:

select *
from the_table
where (startdate, enddate) overlaps (date '2019-01-01', date '2019-01-30');


The overlaps operator works as the name suggest. It would e.g. include a start/end like 2019-01-20/2019-02-05 (because that range "overlaps" with the one specified)

If your input needs to be contained completely in the range defined by startdate/enddate, a query using a date range and the "contains" operator would be better.

select *
from the_table
where daterange(startdate, enddate, '()') &lt;@ daterange(date '2019-01-01', date '2019-01-30', '()');


Or you can use a simple lower than bigger than/lower than condition:

select *
from the_table
where startdate &gt;= date '2019-01-01'
  and enddate &lt;= date '2019-01-30';


Online example (with more data): https://rextester.com/ALJSJE59375