1
select EmpName, EmpCode
from employees
where EmpBrnID = 461 and EmpIsActive =1
and EmpCode not in (select EmpCode from reports
where BranchID = 461 and DAYOFWEEK(InTime)!= 1
and InTime BETWEEN '2017-01-31'- INTERVAL 6 DAY AND '2017-01-31');
我該怎麼寫這個連接。如何寫子查詢不爲空作爲連接
爲什麼你會嗎?但無論如何,你正在尋找**反連接**。 –
@Ramanil你不需要'JOIN'在這裏。你只需要一張表的數據,那麼你爲什麼要加入其他表呢? –
子查詢需要更多時間才能得到結果,所以我想寫join.how以便快速獲得子查詢。@ Jibin Balachandran – Ramanil