In this query I need to remove duplication tutor id and counting them..
SELECT COUNT(t.tutor_id) FROM tutors AS t
INNER JOIN tutor_category_subject as tcs ON t.tutor_id = tcs.tutor_id
INNER JOIN subject AS s ON tcs.subject_id = s.subject_id
WHERE s.subjects LIKE '%business%'
this is query output:
+-------------------+
| COUNT(t.tutor_id) |
+-------------------+
| 6 |
+-------------------+
but it should be 4.. why there tutor ids are 3, 6, 15, 15, 16, 16
Use
distinct