Answer the question
In order to leave comments, you need to log in
SQL JOIN query, how right?
Hello everyone, there are 2 tables:
users: id | name | surname
courses: id | user_id | description | type
How will it be correct to get all courses with type = 1 + by user_id to get name and surname?
I have been working with SQL JOIN's for a long time, I don’t even know how to do it ..
something like this?:
SELECT c.*, u.name, u.surname FROM courses AS c INNER JOIN users AS u ON c.type = 1 AND u.id = c.user_id
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question