CoreTrail

Filtering & expressions

Select the right rows and reason carefully about missing values.

Chapter overviewPostgreSQL2 min read
On this page

Choose the rows before transforming them

Filtering defines the population every later operation sees. Learn inclusive boundaries, membership, pattern matching, and three-valued null logic together: a predicate that becomes unknown can remove rows you expected to keep.

Suggested route: Start with predicates, then compare null behavior in CASE, IN, and NOT IN. Follow existence questions into the subqueries chapter.

By the end: Explain a date boundary and a null-containing comparison set using concrete rows.

Decision reference

Need Construct and check
Inclusive range BETWEEN; both boundaries included
Whole timestamp day >= start AND < next start
Membership IN; check null semantics
Missing values IS NULL / IS NOT NULL
Conditional expression CASE; decide ELSE behavior
Text match LIKE / ILIKE / regex; dialect and pattern semantics

In this chapter

How to study

Use the suggested route above. For each lesson, explain the decision in your own words, test its example, and identify a situation where a different approach would be needed.

Type a concept, keyword, or function.