SQL Server Convert multiple Rows(visit dates) to Column using pivot

17 Views Asked by At

I need help with converting multiple date of visits into columns using SQL server. I know this can be done in pivot. I have tried but can't get it to work. Any help would be greatly appreciated. Thanks much! I have sample data in columns; ID,DOB, visitDate and NumberOfVisits. enter image description here

and would like to have outputs look like this. enter image description here

0

There are 0 best solutions below