i have two tables like this
i want retrive cname from person where cid duplicated at per_db and did at per_db=$value
i want sql statment return "wael" from person
person
cname | cid
-----------
gamal | 1
wael | 2
samy | 3
-------------
per_db
cid | did
----------
1 | 1
2 | 1
2 | 2
3 | 2
any help