查询订单表里用户的第一笔订单

1
SELECT `user_id`, MIN(`pay_time`) FROM `order` GROUP BY `user_id`;