我们希望了解所有员工及其雇用日期,以便他们的雇佣日期大于雇佣人员的雇用日期'戴维斯'这两个问题在时间和空间复杂性方面如何相互比较?
SELECT e.last_name, e.hire_date
FROM employees e
JOIN employees davies ON (davies.last_name = 'Davies')
WHERE davies.hire_date < e.hire_date;
SELECT e.last_name, e.hire_date
FROM employees e
JOIN employees davies ON (davies.hire_date < e.hire_date)
WHERE davies.last_name = 'Davies';
答案 0 :(得分:0)
你可能正在寻找这个
SELECT e.last_name, e.hire_date
FROM employees e
WHERE e.hire_date > (SELECT TOP (1) hire_date FROM employees WHERE last_name = 'Davies')