Does anyone have any recommendations on how to solve the following?
I would like to have a query that selects ALL columns from a database,
however only records that have a count of a certain column which is
greater than 1 when the results are grouped by a few columns. I know
the following query doesnt work (because it contains items in the
SELECT that arent in the GROUP BY), but its the jist of what I need to
do.
select a,b,c,d,e,f,g,h
from table1
group by a,b,c,d
having count(e) > 1
Can anyone help me out with this?
I would like to have a query that selects ALL columns from a database,
however only records that have a count of a certain column which is
greater than 1 when the results are grouped by a few columns. I know
the following query doesnt work (because it contains items in the
SELECT that arent in the GROUP BY), but its the jist of what I need to
do.
select a,b,c,d,e,f,g,h
from table1
group by a,b,c,d
having count(e) > 1
Can anyone help me out with this?
Comment