select p.username, o.organizationname, coalesce(t.organizationid, t.mockingorganizationid) orgid from contests c inner join contestteams ct on c.contestid = ct.contestid inner join teams t on ct.teamid = t.teamid inner join organizations o on o.organizationid = coalesce(t.organizationid, t.mockingorganizationid) inner join organizationpersons op on o.organizationid = op.organizationid inner join persons p on op.personid = p.personid where c.contestid in ( select be.contestid from basketballevents be left join teams t1 on be.teamid = t1.teamid left join players pl on be.playerid = pl.playerid inner join teams t2 on t2.teamid = coalesce(t1.teamid, pl.teamid) group by be.contestid having count(distinct t2.teamid) > 2 )