reusing subquery in postgresql

I have a query which works just fine, however I use the same subquery twice in it. I would like to know if there is a way to reuse this…

Read more