I have a web site that collects feedback from two forms. I have a SQL query that returns the names of users who have submitted feedback through one or both of them. The feedback forms are given ID's 5 and 6 in the table's feedback column.
SELECT 1.firstname, 1.lastname, 2.feedback, 2.timemodified
FROM 1
INNER JOIN 2 ON 1.id = 2.userid
ORDER BY 1.lastname
This returns a result set that looks like this:
firstname lastname feedback timemodified
--------- -------- -------- ------------
john doe 5 1471012069
john doe 6 1471012075
jane smith 5 1471013449
jane smith 6 1471055903
joe blow 6 1473058839
jim jones 5 1471033691
I am only interested in those users who have submitted feedback through BOTH forms (5 and 6). I would like to filter my result set so that anyone who has not is eliminated and those who have are listed only once. (e.g., the above result set should only show john doe and jane smith, one time each.) Ideas?