Mysql之group by与having使用
1、筛选用户为3的数据
select id,user_id,mobile FROM account where user_id=3;
执行结果如下:
2、按用户进行分组
SELECT id,user_id,mobile,count(1) FROM financial GROUP BY user_id having count(*)>1;
执行结果如下:
其中: 以下三个写法表达的意思...
原创
2019-11-06 13:50:42 ·
506 阅读 ·
0 评论