从返回多列的子查询中选择单列

时间:2017-09-27 07:43:51

标签: mysql vertica

这是我的查询

select *
from table  
where a in (select a,b,count(*) from table where b= 99991231 group by 1,2 having count(*) > 1)  ;

ERROR 4829:  Subquery has too many columns

我想选择其中b值为99991231且重复多次的值

1 个答案:

答案 0 :(得分:1)

如果没有子查询,您可以将其写为

select a
from table 
where b= 99991231 
group by a
having count(*) > 1