SQL · Amazon · Medium
Problem You have an orders table with the columns merchant_id, order_date, and order_id. Write a SQL query that returns the first order placed by each merchant on every date. The order_date values use the YYYY-MM-DD format. For each merchant and date combination, treat the order with the smallest order_id as the first order. The result must contain these columns: merchant_id order_date first_order_id Example Input: Output: The result keeps one row for each merchant-date…
Checking your access…