2014-06-27 42 views

回答

0

爲了讓您的 '千斤頂' 表中,你只需要一個連接:

select e.employee_name, e.hiredate 
from employees e 
join employees jack on jack.employee_name = 'Jack' 
where e.employee_hiredate > jack.hiredate; 

另外,您可以使用子查詢:

select e.employee_name, e.hiredate 
from employees e 
where e.employee_hiredate > (select hiredate from employees where employee_name = 'Jack'); 

This article可能會給你更好的解釋如何加入工作,並且this article會解釋一些關於s ubqueries。

0
Select * 
from employees e 
where convert(date,e.employee_hiredate) > (select convert(date,e.employee_hiredate) 
              from employees 
              where employee = 'jack' 
              ) 
0

由於您要選擇只與特定員工進行比較的記錄,因此您可以使用子查詢。

甲骨文,你也許可以這樣做:

select e.employee_name, e.hiredate 
from employees e 
where TRUNC(e.employee_hiredate) > (SELECT TRUNC(HIREDATE) FROM EMPLOYEES WHERE EMPLOYEE_NAME = 'Jack'); 
相關問題