This is usually easier to transform at your presentation layer, but if you must do it in T-SQL, you can do something like this:select indexA, max(case when indexB=1 then firstname end) as firstname1, max(case when indexB=1 then surName end) as surName1, max(case when indexB=2 then firstname end) as firstname2, max(case when indexB=2 then surName end) as surName2, .. etc ..from yourtablegroup by indexA
- Jeffhttp://weblogs.sqlteam.com/JeffS