I have two tables: contracts and postings, both are linked by contract id. There can be none or several entries in postings for each contract.
I want to count the number of contracts with a certain status and no entry in postings. So I guess I need to aggregate the number of postings, but how am I able to put this as a condition in the set expression?
Aggregation of postings per contract ID, replacing missings with "0":