When i run this query in data bricks i get the following error
[INVALID_SUBQUERY_EXPRESSION.SCALAR_SUBQUERY_RETURN_MORE_THAN_ONE_OUTPUT_COLUMN] Invalid subquery: Scalar subquery must return only one column, but got 3. SQLSTATE: 42823
`select
all.a,
all.b,
all.c
from com a11
join fam_grp a12
on ((a11.mkt_id || a11.brd_id) = (a12.mkt_id || a12.brd_id) and
a11.dataset = a12.dataset)
where ((a11.cust_id,
a11.mkt_id,
a11.o_cust_id)
in (((select pc21.cust_id,
pc21.mkt_id_1,
pc21.o_cust_id
from ZZMD00 pc21
group by pc21.cust_id,
pc21.mkt_id_1,
pc21.o_cust_id)
intersect (select pc21.cust_id,
pc21.mkt_id_1,
pc21.o_cust_id
from ZZMD01 pc21
group by pc21.cust_id,
pc21.mkt_id_1,
pc21.o_cust_id)))
and a11.dataset in ('C'))
group by
all.a,
all.b,
all.c`
I tried to use not sure where i am going wrong
New contributor
Evanoooo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.