I have two existing table {PeopleList, EmployeeList}. My problem is how to create a query that joins the other table if a record exist in column but if not, returns the other record of the other column. To make it more clear, i will provide some informations (dummy records) below:
PeopleList Table
AutoInc_ID EmployeeID Name
============================================
1 EMP001 Mr. John Doe
2 Mr. Johnsons
3 Mrs. Jane Smith
4 EMP002 Mr. Juan Dela Cruz
and
EmployeeList Table
EmployeeID AliasName DepartmentID
============================================
EMP001 JDoe DEP001
EMP002 JDCruz DEP001
EMP003 Alien DEP051
and the result i want is:
Result Table
AutoInc_ID WorkerName
============================================
1 JDoe
2 Mr. Johnsons
3 Mr. Jane Smith
4 JDCruz
1 Answer