Hi,
I have two tables that I need to compare. Here are the two tables and the detail:
First select statement from NoLongerEmployee table:
SELECT Employee_Name, Hire_Date, Department_ID
FROM NoLongerEmployee
and below is the result set of the above query:
Employee_Name Hire_Date Department_ID
Barry Small 04/20/2013 HLPDSK345
Melinda Tan 02/03/2012 MGR455
Jose Runo 11/16/2013 CUSTSRV554
Barry Small 04/12/2015 APPDEV234
Christine Lie 03/21/2013 QC234
Nichole James 07/08/2013 SVC323
Vicki Johnson 06/24/2014 MGR776
Bryan Kosh 01/16/2015 IT334
Second select statement from StillEmployee table:
SELECT Employee_Name, Hire_Date, Department_ID
FROM StillEmployee
and below is the result set of the above query:
Employee_Name Hire_Date Department_ID
Barry Small 04/20/2013 HLPDSK345
Melinda Tan 02/03/2012 MGR455
Jose Runo 11/16/2013 CUSTSRV554
Barry Small 04/12/2015 APPDEV234
Christine Lie 03/21/2013 QC234
Nichole James 07/08/2013 SVC323
Melinda Tan 05/05/2016 MGR556
What I am trying to achieve is to compare between table NoLongerEmployee and StillEmployee to match all those three fields row by row. I want to get the result set in the NoLongerEmployee table where the records are not listed in StillEmployee table based on matching fields row by row.
The result set I want to see from table NoLongerEmployee should like below:
Employee_Name Hire_Date Department_ID
Vicki Johnson 06/24/2014 MGR776
Because - (No matching on the Employee_Name. Hire_Date and Department_ID fields between NoLongerEmployee and StillEmployee)
Bryan Kosh 01/16/2015 IT334
Because - (No matching on the Employee_Name. Hire_Date and Department_ID fields between NoLongerEmployee and StillEmployee)
Anyone knows how do I achieve this?