sql--查询

查询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

猜你喜欢

转载自blog.csdn.net/weixin_41355124/article/details/80185654