I have two tables Userdb
and Approval
. Both tables have a common column but different names (LanID
& UserID
). In the Userdb
, there are columns LanID, Name, DepartmentName
.
I need to show these records :
- His own records
- All records in the same department
My current code:
SELECT
Userdb.LanID, Approval.UserID
FROM
Userdb_table, Approval_table
JOINS
Approval_table ON Userdb.LanID = Approval.UserID
My current code does not fulfill the second condition, how can I do that?