Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-08-15 : 07:37:55
|
| Anitha writes "I am just a beginner and i need help to solve the below problem in sql I have 6 records in info table name id phoneani 1 999-980-234ani 1 999-980-145ani 1 999-980-913bav 2 888-000-999bav 2 888-000-991I want it to be into one record name id phone1 phone2 phone3 ani 1 999-980-234 999-980-145 999-980-913bav 2 888-000-999 888-000-991I want my sql to dynamically create columns and append dataI an do it by assigning the values individually .. which is really tedious .Appreciate it if you could help me . Thank you ,Anitha" |
|
|
timmy
Master Smack Fu Yak Hacker
1242 Posts |
Posted - 2005-08-15 : 07:43:12
|
| You're referring to what is sometimes known as a crosstab query. It's usually used to display totals and stuff like that (ie aggregates), but not normally to do this sort of thing. It might get quite ugly.Is the number of phone numbers a person can have fixed? |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|