Advertisement
dragonbs

Employee 24

Sep 28th, 2023
1,443
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.31 KB | None | 0 0
  1. SELECT e.[EmployeeID], e.[FirstName],
  2.     (CASE
  3.         WHEN  DATEPART(YEAR, p.[StartDate]) >= 2005 THEN NULL
  4.         ELSE p.[Name]
  5.     END) AS [ProjectName]
  6. FROM [Employees] e
  7. LEFT JOIN [EmployeesProjects] ep ON e.[EmployeeID] = ep.[EmployeeID]
  8. LEFT JOIN [Projects] p ON ep.[ProjectID] = p.[ProjectID]
  9. WHERE e.[EmployeeID] = 24
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement