by Luis de Vasconcelos.
The one that you origionally posted and shows the duplicates:
SELECT question, attempt, seq_number,
COUNT (seq_number) AS NumOccurrences
FROM mdl_question_states
GROUP BY question, attempt, seq_number
HAVING (COUNT(seq_number) > 1)