Answer the question
In order to leave comments, you need to log in
How to get multiple values from an attached table?
The title is a little chaotic, I don't know how to phrase it better.
So, there are, in a simple version, 2 tables connected by a many-to-many association:
USERS
id | username
1 | Арнольд
2 | Сильвестр
id | title
1 | Математика
2 | Физика
user_id | subject_id
1 | 1
1 | 2
2 | 1
SELECT users.id, users.username, users_subjects.subject_id AS sid FROM users
LEFT JOIN users_subjects ON users_subjects.user_id
GROUP BY users.id /*эта штука мне нужна*/
Answer the question
In order to leave comments, you need to log in
How to get multiple values from JOIN?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question