elena1234

PIVOT ( T-SQL)

Mar 8th, 2022 (edited)
1,603
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.23 KB | None | 0 0
  1. SELECT
  2. [Sales Representative],
  3. [Buyer],
  4. [Janitor]
  5. FROM
  6. (
  7. SELECT
  8. JobTitle,
  9. VacationHours
  10. FROM HumanResources.Employee
  11. ) AS A
  12.  
  13. PIVOT(
  14. AVG(VacationHours)
  15. FOR JobTitle IN([Sales Representative], [Buyer], [Janitor])
  16. ) AS B
  17.  
Add Comment
Please, Sign In to add comment