Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 query help

Author  Topic 

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2008-09-04 : 02:34:25
i have a table placements and table participants

participants is linked to placements by participantsid
(there can be more then one placement per particpant)

how can I query all those participants that have more then 1 placement record (records in placements table with that partipantid)

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-04 : 02:38:06
[code]SELECT p.*
FROM participants p
INNER JOIN (SELECT participantid
FROM placements
GROUP BY participantid
HAVING COUNT(1) >1)pl
ON pl.participantid=p.participantid[/code]
Go to Top of Page
   

- Advertisement -