Advertisement
dragonbs

Employees from Town

Oct 5th, 2023
1,623
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.31 KB | None | 0 0
  1. CREATE PROC usp_GetEmployeesFromTown (@townName NVARCHAR(MAX))
  2. AS
  3. BEGIN
  4.     SELECT
  5.         [FirstName][First Name]
  6.         ,[LastName][Last Name]
  7.     FROM [Employees][e]
  8.     LEFT JOIN [Addresses][a] ON [e].[AddressID] = [a].[AddressID]
  9.     LEFT JOIN [Towns][t] ON [a].[TownID] = [t].[TownID]
  10.     WHERE [t].[Name] LIKE @townName
  11. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement