查询id重复3次以上的数据:
select * from users where id in ( select id from users group by id having count(*)>=3 )
查询前10条数据并按age排序:
select * from users where 1=1 order by age limit 10
查询id重复3次以上的数据:
select * from users where id in ( select id from users group by id having count(*)>=3 )
查询前10条数据并按age排序:
select * from users where 1=1 order by age limit 10