select * from SS s where s.id in ( select sd from SDT where vd in ( '00:e0:4c:68:3d:91','00:e0:4c:68:3c:ba') group by sd having count(sd) >= 2 )