每位用户的首单

窗口函数中等

题目描述

查询每位用户最早的一笔订单(同日取 id 较小者),返回 user_id、first_order_id、amount 三列(列名必须是 first_order_id)。