Table 1 : Contacts
Fields : id | first_name | last_name
Table 2 : email (it contains contact_id of contacts table)
Fields : id | contact_id | email_address
我需要根据first_name
,last_name
和email_address
找到重复的联系人。
答案 0 :(得分:0)
试试这个
SELECT R.first_name , R.last_name, S.email_address
FROM Table1 R
INNER JOIN Table2 S ON R.id = S.Contactid
Group By R.first_name , R.last_name, S.email_address
Having Count(S.Contactid)>1;