Forum Discussion
Lexterb
Mar 06, 2024Copper Contributor
Rows to columns
This is my source table. I use this script but the output is not aligned, iI want that the same date is aligned. SELECT top 10 empno , [0] as [punch_code0] , [1] as [punch_code1] , [2] as ...
olafhelper
Mar 07, 2024Bronze Contributor
Lexterb , the better term for "Rows to columns" is pivot data, see Using PIVOT and UNPIVOT - SQL Server | Microsoft Learn