• Select Name,COUNT(distinct id)

    from @table

    group by name

    having COUNT(distinct id) =3