Over the next few days we are going to start the migration to a new forum application. I'm going to start with high post count and active users. You may receive an invitation to the new forums. It's not spam. It's just me trying to seed the user base. My goal is to open it up over the weekend.

Once we open the site we'll block registrations here. We should be open shortly on the new site.

SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 sql 2000 table format
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Constraint Violating Yak Guru

433 Posts

Posted - 06/05/2006 :  04:36:58  Show Profile  Reply with Quote
There is a table with the following fields:
Usercode 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 B3

1 2005 2BM 12 7 9 11
2 2002 BB1 87 98 4 32
3 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.


A2 12 87 45
A3 7 98 32
B2 9 4 88
B3 11 32 12

Since 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):


user info
positive nums
A2 12 87 45
yesterdays info
negative values
A3 7 98 32
contact manage
B2 9 4 88
contact method
B3 11 32 12


Edited by - fmardani on 06/05/2006 04:43:22

In (Som, Ni, Yak)

17689 Posts

Posted - 06/05/2006 :  05:46:49  Show Profile  Reply with Quote
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.


Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000