Postgres Left Join with where condition
问题 I need to left join two tables with a where condition: time_table id rid start_date end_date 1 2 2017-07-01 00:00:00 2018-11-01 00:00:00 2 5 2017-01-01 00:00:00 2017-06-01 00:00:00 3 2 2018-07-01 00:00:00 2020-11-01 00:00:00 record_table id name date 1 record1 2017-10-01 00:00:00 2 record2 2017-02-01 00:00:00 3 record3 2017-10-01 00:00:00 I need to get all those records which are present under given date range. In the above example, I need those records that lie under range for rid = 2 only.