答案 0 :(得分:0)
在这里你有它(它只需要检查是否存在具有相同名称但不同来源的行):
SELECT *
FROM MY_TABLE
WHERE EXISTS (SELECT *
FROM MY_TABLE as ALTERNATE_SOURCE
WHERE MY_TABLE.tep_first_name = ALTERNATE_SOURCE.tep_first_name and
MY_TABLE.tep_last_name = ALTERNATE_SOURCE.tep_last_name and
MY_TABLE.te_source <> ALTERNATE_SOURCE.te_source)
答案 1 :(得分:0)
SELECT
*
FROM
MyTable
WHERE
tep_PK IN
(
SELECT
tep_PK
FROM
MyTable
GROUP BY
tep_PK
HAVING
COUNT(*) > 1
)
答案 2 :(得分:0)
使用以下查询。
SELECT *
FROM YourTable a
JOIN ( SELECT tep_lastname,tep_FirstName
FROM YourTable
GROUP BY tep_lastname,tep_FirstName
HAVING COUNT(DISTINCT te_source)>1)b
ON a.tep_lastname=b.tep_lastname AND a.tep_FirstName=b.tep_FirstName