For each customer, find their first order. Return the customer's full name, the order_date of their first order, and the total_amount. Use a CTE with ROW_NUMBER to identify the earliest order per customer. Sort by order_date.
Schema
🔑idINT
first_nameTEXT
last_nameTEXT
emailTEXT
phoneTEXTNULL
cityTEXT
stateTEXT
countryTEXT
created_atTIMESTAMP
postgresql
Run your query to see results
Press Ctrl + Enter to execute