> 其他 >
数据库group by语句
select * from hb_student_info where card_id in(select card_id from hb_student_info group by card_id having count(card_id)>1)
我知道这句的功能是查找出card_id相同的纪录 具体是怎么实现功能的,count函数大于1是什么意思?
人气:400 ℃ 时间:2020-02-03 14:38:34
解答
select card_id from hb_student_info group by card_id having count(card_id)>1group by 是按照card_id分组,配合having做条件筛选比如hb_student_info中数据如下:card_id 栏位1 栏位2 001 1 2001 2 2001 3 4002 4...
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版