PostgreSQL Subquery as predicate in WHERE clause.

In Exploring subqueries in PostgreSQL – Column names and expressions, I discussed generating SELECT statement columns and expressions with subqueries. This blog post will visit another common pattern. Subqueries as predicate filters in the WHERE clause.

For the full post, continue reading…


Exploring subqueries in PostgreSQL – Column names and expressions.

There is an old saying that there is more than one way to skin a cat. Fear not, I won’t be skinning any, but that saying applies for many queries within PostgreSQL (and SQL in general). While the structure of some queries are ideal for execution, speed, and performance others are useful for analysis, exploration, and reporting. In this blog post, I’ll explore using subqueries to generate SELECT statement columns.