Don't have Telegram yet? Try it now!
https://blog.devoworx.net/2017/09/08/convert-rows-to-columns-using-dynamic-pivot-in-sql-server/
Convert Rows To Columns Using Dynamic Pivot In SQL Server