I’m not good with the old JOIN statements and looking for a little friendly help. I have two tables, lets say table Employee:
LastName DepartmentID
Rafferty 31
Jones 33
Steinberg 33
Robinson 34
Smith 34
John NULL
and table Department:
DepartmentID DepartmentName
31 Sales
33 Engineering
34 Clerical
35 Marketing
if I want to return results where DepartmentID=31 AND only results where Employee.DepartmentID = Department.DepartmentID, so that the returned result would look like this:
Employee.LastName Employee.DepartmentID Department.DepartmentName
Rafferty 31 Sales
(we can drop one of the DepartmentID’s since they are the same) – what is the SQL statement that will accomplish that?
Thanks
1 Answer