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 |
|
kiran
Starting Member
30 Posts |
Posted - 2004-04-13 : 14:31:30
|
| I need to show row values as column headings as mentioned in the given example. The problem is my property names are not definite. They can grow or shrink...Ex:Select PropertyName, PropertyValue From problems PropertyName PropertyValue------------ ------------FirstName JasonLastName GoldPhone 111-111-111... ....FirstName GeorgeLastName MathewsPhone 222-222-222.... ......How to convert this to FirstName LastName Phone .... .....--------- -------- ----- ----- -------Jason Gold 111-111-1111 .... ....George Mathews 222-222-2222 .... .......... ....... ...... .... .....Thanks in advance.. |
|
|
MichaelP
Jedi Yak
2489 Posts |
Posted - 2004-04-13 : 14:35:20
|
| Do some searching on this forum or on the parent site for crosstab or dynamic crosstab. I'm pretty sure that's what you are looking for.Michael<Yoda>Use the Search page you must. Find the answer you will.</Yoda> |
 |
|
|
kiran
Starting Member
30 Posts |
Posted - 2004-04-13 : 14:50:41
|
| Thanks for your reply, I tried using the search, looks-like all the articles are talking about grouping and summing the values. Do you have any specific link i can use.Thanks again.... |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2004-04-13 : 14:55:24
|
| How do you plan to organize the data in to rows?Why for example wouldn't Jason get 222-22-2222?Is there something that ties the rows together?The order of data in a database is meaningless....Brett8-) |
 |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2004-04-14 : 09:07:49
|
| You are correct about the examples doing some sort of "math" on the values, not just displaying them ... that is because by definition to summarize you must do some calculations on a set of values to decide what value to display.in the case of text, and if there will always only be 1 value per column/row, then you can just use MAX, it will be the equivalent of just putting the value in the column you want. That is because the MAX of only one value IS that particular value.so use Rob's technique or any other and just summarize the text column using the MAX() aggregate function.but, as stated by Merkin/Brett, i hope there is more to your sample data than what you have displayed since there is no relationship between the differnet rows in your data as is.- Jeff |
 |
|
|
|
|
|