Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 根据其他列查找重复列_Sql - Fatal编程技术网

Sql 根据其他列查找重复列

Sql 根据其他列查找重复列,sql,Sql,我有3个专栏作为参考 Column1 column2 column3 GU1 1 a GU1 2 a GU1 3 a GU2 4 b GU3 5 c GU4

我有3个专栏作为参考

Column1           column2            column3
GU1                 1               a
GU1                 2               a
GU1                 3               a
GU2                 4               b
GU3                 5               c
GU4                 6               a
GU4                 7               b
我想过滤掉第1列,其中的值有多个第3列值


在本例中,我想在GU4的第3列中同时显示a和b。在您的
计数中使用
distinct

select column1
from your_table
group by column1
having count(distinct column3) = 1

在您的
计数中使用
distinct

select column1
from your_table
group by column1
having count(distinct column3) = 1