I have a query which is supposed to be embedded as a subselect statement later. It however yields more than one column as a result, which obviously returns to many values.
The statement looks like this:
select
a.some_primary_key
, b.some_column
, count(b.some_column)
from
a join b ...
where
...
group by
a.some_primary_key
, b.some_column
having
count(b.some_column) > 1
Then I would like to use whatever results are given in the "a.some_primary_key"-column for another query, which would look like this.
select
*
frome
some_view
where
some_view.some_primary_key in (
...
)
Is there a way to somehow omit the other columns (b.some_column, count(b.some_column) )?
Thanks in advance.