I have a Select Statement that pulls all of the Publication by the ID that have Multiple entries. Having multiply entries is what I'm looking for so I can determine with the authors work for the same program/department or a different one. I'm not interested in single authors. This give me all of the Publications that are written in the same program.
SELECT TOP (100) PERCENT dbo.[Publication.Person.Include_queue].PMID
FROM dbo.[Publication.Person.Include_queue] INNER JOIN
dbo.ADMIN_Membership ON dbo.[Publication.Person.Include_queue].MemberID = dbo.ADMIN_Membership.MemberID
WHERE (dbo.[Publication.Person.Include_queue].dbid = 750)
GROUP BY dbo.[Publication.Person.Include_queue].PMID, dbo.ADMIN_Membership.Program_Code
HAVING (COUNT(*) > 1)
ORDER BY dbo.[Publication.Person.Include_queue].PMID
What I need is all PMID's for Publications that have a count of greater than 1 with different Program_code's. I think I need to create a sub query but not sure how to do that with structure.
So something like this fake pseudo code I think is what I need:
Select PMID Where PMID.Count > 1 and Program_Code,Count > 1
I looked at How to get multiple counts with one SQL query? and it's close but not quite.