SQL CTE example

Use a SQL common table expression (WITH) to organize a multi-step query.

The CTE calculates each employee's team average before the outer query selects people earning above that average.

Write a query, load data, or pick a learning example.

Run with Cmd/Ctrl+Enter