一种mysql 实现用户前两条语句方案

  select   * FROM (
 SELECT @row_number := CASE WHEN  @customer_no = user_id THEN @row_number + 1 ELSE 1 END AS num,
     @customer_no := user_id AS user_id,
     id,
     update_time
 FROM expert_course,   (SELECT @row_number:=0, @customer_no:=0) AS temp
 ORDER BY user_id DESC
) AS a
WHERE a.num <= 2
ORDER BY update_time;

一种mysql 实现用户前两条语句方案

上一篇:在Ubuntu中搭建.NET开发环境


下一篇:linux安装MySQL