I want to Table name: Master_Vendors
Vendor_ID Subvendor_id Subvendor_type Name City State
1 abc 1 Johnny York MN
1 xyz 2 Meera Birmingham NY
1 gef 3 Gaurav Cochin NY
2 aaa 1 Laila Lima MA
2 bbb 2 Zebo Reno SC
2 ccc 3 Gina Pitts NY
I want one row per Vendor_ID and i cannot use any aggregations
Vendor_ID Subvendor_id_1 Name_1 City_1 State_1 Subvendor_id_2 Name_2 City_2 State_2
1 abc Johnny York NY xyz Meera Birmingham NY
2 aaa Laila Lima MA bbb Zebo Reno SC
since i cannot do aggregations i cannot use PIVOT; i have never used CTE's before can we acheive this using CTE?