简体   繁体   English

Select 具有一个或多个相同值的行

[英]Select rows which are having same values one or more

在此处输入图像描述

From this table, i would like to select profiles which share the same phone number one or more times.从这张表中,我想 select 配置文件共享相同的电话号码一次或多次。 Output should be: Output 应该是:

在此处输入图像描述

Probably you're looking for GROUP BY and HAVING:可能您正在寻找 GROUP BY 和 HAVING:

SELECT * FROM profiles WHERE Phone IN (
    SELECT Phone
      FROM profiles
     GROUP BY Phone
    HAVING count(*) > 1);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 MySQL-选择多个具有相同值的行,其中一个必须不同 - MySQL - Select multiple rows with the same values with one having to be different 选择查询,使那些行具有两个或多个两个非零值 - Select query which give those rows having two or more than two non-zero values 选择具有相同列值(1个或更多)的“组”行 - Select “group” of rows with same column values(1 or more) 如何仅选择具有多个具有值的给定字段的行 - How to select only those rows which have more than one of given fields with values 选择一对在一行中具有相等值而在另一列中具有不同值的行 - Select a couple of rows having equal values in one column and different in another 选择在一列中具有相等值的行,但不是单独的行 - Select rows having equal values in one column but not those are alone MySQL SELECT行可响应其中一列中的特定MULTIPLE值 - MySQL SELECT rows which respond to specific MULTIPLE values in one of the columns 使用 SQL HAVING COUNT 查找仅显示某些列值重复多次的行 - Using SQL HAVING COUNT to find display only rows in which certain column values are repeated more than once SQl查询以使具有相同ID但具有不同值且具有相同日期字段的多行缩编 - SQl Query for concating multiple rows with same ids but with different values which having same datefields Mysql选择一列中具有相同值而另一列中具有不同值的行 - Mysql Select rows with same values in one column and different in another
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM