I have a table #rah that contains only two columns (customer id and product)
Table values
product customer id
PD 100045592
PD 100030983
PD 210330909
PDRU 200067524
PDRM 210007421
Does anyone know the best way I can use the PIVOT function in SQL Server 2008 to write this?
Desired output:
Product Count
PD 3
PDRU 1
PDRM 1
Any help is appreciated.