N
N
nikita_arut2014-12-01 18:03:30
MySQL
nikita_arut, 2014-12-01 18:03:30

Combining On, In and As in Sql?

Thanks to one wonderful person (many thanks to him), there is such a request

LEFT JOIN hw_10 ON hw_10.subject_id IN (schedule.`first`, schedule.`second`, schedule.`third`, schedule.`fourth`)

Actually, everything works, but only zero values ​​are skipped, and without them everything will be wrong. The question is: how to give each result a unique column like "hw1", "hw2", "hw3"...etc.
I would be very grateful for your help!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Armenian Radio, 2014-12-01
@gbg

You need to join c hw_10 a dozen times, giving it different aliases:
left join hw_10 hw_10first on(hw_10first.subject_id=schedule.first)
left join hw_10 hw_10second on(hw_10second.subject_id=schedule.second)
...
Your architecture is at the seams, I need to redo everything, to be honest.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question