N
N
nikita_arut2014-11-29 15:23:35
MySQL
nikita_arut, 2014-11-29 15:23:35

Completely confused, Help me, what and where is wrong?

So, there are 2 tables - schedule and subjects. I'm trying to use left join in conjunction with where, but so far it doesn't work.
schedule looks like this: 26b0d041dac945fb9cb37af4ed44e0c5.png
subjects like this:
97b31e36c9974525a9f7c10301aeb597.png
Everything is displayed, but only if there is only 1 entry in the schedule. I understand that "WHERE ... ='Monday'" and "WHERE ...`student_id`='1'" do not work, but I can't figure out how to make them work. I really ask for help.
SQL code: pastebin.com/q2bqedf8

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2014-11-29
@nikita_arut

in join conditions only
`subjects`.`subject_id` = `schedule`.`second`
...
`subjects`.`subject_id` = `schedule`.`tenth`
filters in WHERE

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question