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