In this query, DISTINCT key word is not working. display duplicate subjects from subject table.. can anybody tell me where I have made mistake?
SELECT DISTINCT
tutor_category_subject.subject_id,
GROUP_CONCAT(subject.subjects SEPARATOR ', ') AS subjects
FROM tutor_category_subject
INNER JOIN subject ON tutor_category_subject.subject_id = subject.subject_id
WHERE tutor_category_subject.tutor_id = 3;
I think you need a group by statement: