Let me try to explain this to the best of my ability:
I have a table in which there is a userID column and a program column (along with other columns of non importance). I need to find the users within this table that have multiple instances within this table where that user has a program of X associated with it.
Can anyone help me please?
What I have so far is:
SELECT
WPP.USERID
FROM
WEBPROGRAMPARTICIPANTS WPP
INNER JOIN
WEBPROGRAMS WP
ON
WPP.PROGRAMCODE = WP.PROGRAMCODE
WHERE
CONFIRMED = 1 AND
WP.PROGRAMTYPE IN ('1') AND
WP.PROGRAMSTARTDATE >= '2000-01-01' AND
WPP.PROGRAMCODE = 'CL2010'
GROUP BY
WPP.USERID
HAVING
COUNT(WPP.PROGRAMCODE) > 1