SQL question

Miscellaneous Forums/General Discussion/SQL question

Not sure what DBMS you want it in and exactly what your table structure is but adapt something like this:
Select
    *
From
    Player as P
Where
    (P.ClubId, P.SquadNumber) in
(   Select
        D.ClubId
       ,D.SquadNumber
    From
        Player as D
    Group by
        D.ClubId
       ,D.SquadNumber
    Having
        count(*) > 1
)
Order by
    P.ClubId
   ,P.SquadNumber
   ,P.Id
;


The 'inner' query returns the ClubId, SquadNumber pairs that have more than one occurrence in the Player table.

The 'outer' query then selects the rows that have those values so you can see the player ids and everything else.