Link to home
Start Free TrialLog in
Avatar of swaggrK

asked on

T-SQL using PIVOT to display data

I need to create a join that displays EmployeeID and Rate based on the AttendantCount
Currently the Rate and AttendantCount are displayed as rows but I need to display the data horizontal.
I was told this could possibly be done using PIVOT in t-sql.
I have attached a screenshot of what the result should look like

The CommissionLevelDetail table contains CommissionLevelID, AttendantCount, Rate
The CommissionLevelAssignment table contains CommissionLevelID, EmployeeID

User generated imagetbl_CommissionLevelAssignment.xlsxtbl_CommissionLevelDetail.xlsx
Avatar of Mark Wills
Mark Wills
Flag of Australia image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of swaggrK


Thanks Mark...this was very useful.
My pleasure, and very pleased you found it useful :)