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 |
fmardani
Constraint Violating Yak Guru
433 Posts |
Posted - 2006-06-05 : 04:36:58
|
There is a table with the following fields:id,year,UserCode,A2,A3,B2,B3Usercode is a varchar fields whereas the other fields are integrers.Let's say this is what the table contains at present:id year Usercode A2 A3 B2 B31 2005 2BM 12 7 9 112 2002 BB1 87 98 4 323 1999 3NS 45 32 88 12...The question is, how can I produce something like the following table using the above table:The idea is to show the final table (at the very bottom) on a web page. So I am thinking if I get the table right in sql server then the rest is fine. 2BM BB1 3NSA2 12 87 45A3 7 98 32B2 9 4 88B3 11 32 12Since I am using sql server 2000, I do not think I can use something like the pivot sql functionality as sql 2005 allows.In addition to the above I would like to go one step further to have a sql to produce the following result (Notice the extra texts): 2BM BB1 3NSuser infopositive numsA2 12 87 45yesterdays infonegative valuesA3 7 98 32contact manageB2 9 4 88contact methodB3 11 32 12Thanks |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-06-05 : 05:46:49
|
Can't you do this in your front end application ? SQL Server is for data storage and not meant for Formatting and Presentation of data. KH |
|
|
|
|
|