Created
February 11, 2013 00:05
-
-
Save n-tran/4751619 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select provider_identifier_id | |
from provider_identifier pid | |
join provider p on p.provider_id = pid.provider_id | |
join | |
(SELECT dr.project_id, drid.identifier_type_id, drid.provider_identifier_identity | |
FROM provider_identifier drid | |
left outer JOIN provider dr ON (dr.provider_id = drid.provider_id) | |
WHERE identifier_type_id <> 7 | |
GROUP BY dr.project_id, drid.identifier_type_id, drid.provider_identifier_identity | |
HAVING COUNT(*) > 1) as prob on prob.project_id = p.project_id | |
and prob.identifier_type_id = pid.identifier_type_id | |
and prob.provider_identifier_identity = pid.provider_identifier_identity |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment