Postgresql – Select by two conditions in has_many relation
I struggle with creating a performant select of the database. Following case: A booking has 2 attributes departure and arrival. Both attributes are type date. I want to select all Persons with bookings with departure: 1.month.ago and no Booking in…