- need to bond two queries together? UNIONize!
- (SELECT firstname, surname FROM student JOIN class_student ON class_student.studentid = student.id JOIN class ON class_student.classid = class.id WHERE class.name = 'PHP') UNION (SELECT firstname, surname FROM student JOIN class_student on class_student.studentid = student.id JOIN class ON class_student.classid = class.id WHERE class.name = 'Linux Admin 3');
- or, if you don't feel like typing all that:
- SELECT firstname, surname FROM student JOIN class_student ON class_student.studentid = student.id JOIN class ON class_student.classid = class.id WHERE (class.name = 'PHP' OR class.name = 'Linux Admin 3');
- In a properly normalized and designed database, not all that useful
NEXT
PREVIOUS
Master Index