EasyOutput prediction
Basic CTE with WITH
Given this table (orders):
| id | customer | amount |
|---|---|---|
| 1 | Alice | 100 |
| 2 | Bob | 200 |
| 3 | Alice | 300 |
What does this query return?
WITH totals AS ( SELECT customer, SUM(amount) AS total FROM orders GROUP BY customer ) SELECT customer FROM totals WHERE total > 200;
← → arrow keys to navigate
Sign in to save your progress.