mysql没有row_number,只能用自连接的方法了SELECT a.* FROM 表名 a WHERE (SELECT COUNT(*) FROM 表名 WHERE uid= a.uid AND created_time<= a.created_time ) =3 ORDER BY uid若表名是company_user,取uid最大值,可以查出uid第二条最大记录
select * from company_user where uid=(select max(uid) from company_user) limit 1,1
评论列表(0条)