Advertisement
elena1234

Join one table with itself ( T-SQL )

Dec 30th, 2021 (edited)
5,386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.26 KB | None | 0 0
  1. SELECT employee.EmployeeID, employee.FirstName, employee.ManagerID, manager.FirstName AS ManagerName
  2. FROM Employees AS employee
  3. JOIN Employees AS manager
  4. ON employee.ManagerID = manager.EmployeeID
  5. WHERE employee.ManagerID IN(3,7)
  6. ORDER BY employee.EmployeeID;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement