公司发了一张面试题给我,题目如下:
在test数据库中有个flow_user表,找出email字段中@之前字符相同且大于等于2条的所有记录。最终效果如下:
答案:
select substring_index(`email`,‘@‘,1) as email,count(*) as count from flow_user group by email having count>=2;
标签:img use mysql面试 sql group mail 试题 https 分享
公司发了一张面试题给我,题目如下:
在test数据库中有个flow_user表,找出email字段中@之前字符相同且大于等于2条的所有记录。最终效果如下:
答案:
select substring_index(`email`,‘@‘,1) as email,count(*) as count from flow_user group by email having count>=2;
mysql面试题:字段中@之前字符相同且大于等于2条的所有记录
标签:img use mysql面试 sql group mail 试题 https 分享
原文地址:https://www.cnblogs.com/qichao123/p/8654119.html