Discussion Locked

Sql Question

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have a table in which I need to select only the participants who have multiple rows. I tried the group by and having count(*) > 1 but I need to display each time they are in the table but only if they are in more than one. Thanks.

2 replies

by j.lupo

Try putting your group by or having statement in a sub select. In other words

select * from table t1
where 1 < (select count(1) from table t2
where t1.key = t2.key)

It may not be efficient, but it worked in Oracle for me.

This discussion is closed to new replies.