emp.* FROM employees AS emp WHERE emp.id = (SELECT en.employee_id FROM employee_notes AS en WHERE en.date< 'somedate' ORDER BY date DESC LIMIT 1);
问题是,在上面的查询中,内部SELECT没有过滤具有给定office的employee_notes。emp.* FROM employees AS emp WHERE emp.id = (SELECT en.employee_id FROM e