Postgresql – Where clause dependent on column being populated by a `case select` statement postresql
I'm writing a query where I'm doing a union on several different tables to combine them to make one item. Let's make up an example where I have a table Purchases and a table Leases and I'm creating a new…