Application

Report a typo

We have a table "customers":

customer name sales id country
Jane P. 124 USA
Kris M. 678 England
Miguel K. 765 Spain
Jessica N. 456 USA
Ted B. 678 England
Li Chang 436 China
Pebes J. 567 Brazil

Rearrange multiple CTE requests in correct order to choose customers from England and USA.

Put the items in the correct order
customers_in_USA AS (SELECT * FROM customers WHERE country = 'USA')
SELECT customer name, sales id, country FROM customers_in_England UNION ALL SELECT customer name, sales id, country FROM customers_in_USA;
WITH customers_in_England AS (SELECT * FROM customers WHERE country = 'England'),

Create a free account to access the full topic