All pastes #232802 Raw Edit

Miscellany

public text v1 · immutable
·published 2006-11-01 15:37 UTC
rendered paste body
// this works fine

mysql> select teachers.name from school_jobs LEFT JOIN sent_match ON school_jobs.school_jobs_id = sent_match.job_id RIGHT JOIN teachers ON sent_match.teacher_id = teachers.teacher_id AND teachers.status != -1 ;

// but this gives me an empty set ...

mysql> select teachers.name from school_jobs LEFT JOIN sent_match ON school_jobs.school_jobs_id = sent_match.job_id RIGHT JOIN teachers ON sent_match.teacher_id = teachers.teacher_id WHERE teachers.arrival BETWEEN school_jobs.arrival -2 AND school_jobs.arrival +2 AND teachers.status != -1 ;
Empty set (0.01 sec)

// the values of school_jobs.arrival and teachers.arrival are both smallints and have been tested to match independently ...