假设有流水表 user_list:
  字段:
  1. id;
  2. uid;
  3. song_id;
  4. createtime;
查询所有用户第一条记录
        SELECT uid 用户账号,song_id 歌曲id,createtime 点播时间 FROM (SELECT * FROM user_list ORDER BY createtime) a GROUP BY a.uid
查询所有用户最后一条记录
        SELECT uid 用户账号,song_id 歌曲id,createtime 点播时间 FROM (SELECT * FROM user_list ORDER BY createtime DESC) a GROUP BY a.uid