With

The with clause provides a way of defining a temporary relation whose definition is available only to the query in which the with clause occurs.

Ex. Find all departments with the maximum budget:

with max_budget (value) as (select max(budget) from department)
select budget from department, max_budget
where department.budget = max_budget.value;

Last updated