Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- schedule.student_id
- , schedule.`day`
- , tfirst.subjects
- , tsecond.subjects
- , tthird.subjects
- , tfourth.subjects
- , tfifth.subjects
- , tsixth.subjects
- , tseventh.subjects
- , teighth.subjects
- , tninth.subjects
- , ttenth.subjects
- FROM schedule
- LEFT JOIN subjects tfirst ON tfirst.subject_id = schedule.`first`
- LEFT JOIN subjects tsecond ON tsecond.subject_id = schedule.`second`
- LEFT JOIN subjects tthird ON tthird.subject_id = schedule.third
- LEFT JOIN subjects tfourth ON tfourth.subject_id = schedule.fourth
- LEFT JOIN subjects tfifth ON tfifth.subject_id = schedule.fifth
- LEFT JOIN subjects tsixth ON tsixth.subject_id = schedule.sixth
- LEFT JOIN subjects tseventh ON tseventh.subject_id = schedule.seventh
- LEFT JOIN subjects teighth ON teighth.subject_id = schedule.eighth
- LEFT JOIN subjects tninth ON tninth.subject_id = schedule.ninth
- LEFT JOIN subjects ttenth ON ttenth.subject_id = schedule.tenth
- WHERE
- schedule.student_id = '$id'
Advertisement
Add Comment
Please, Sign In to add comment