Answer the question
In order to leave comments, you need to log in
How to output a query with 2 inner join using SQL?
Hello.
There are 3 tables in the database act_courses , inf_courses and inf_statuses .
act_courses :
Answer the question
In order to leave comments, you need to log in
Try something like this:
SELECT inf_courses.name, inf_statuses.name, count(*) cnt FROM act_courses
LEFT JOIN inf_courses ON act_courses.course_id = inf_courses.id
LEFT JOIN inf_statuses ON act_courses.status_id = inf_statuses.id
GROUP BY act_courses.course_id, act_courses.status_id -- для группировки по курсу и статусу
-- либо GROUP BY act_courses.course_id для группировки только по курсу
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question