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

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Reverse pivot table
 New Topic  Reply to Topic
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

bklr
Flowing Fount of Yak Knowledge

India
1693 Posts

Posted - 02/04/2009 :  04:04:30  Show Profile  Reply with Quote
ur welcome

try to post as new post don't post ur query in other's post
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 02/04/2009 :  09:06:53  Show Profile  Reply with Quote
quote:
Originally posted by basawareddy

Hi Bklr,

its Great, i got exact result.
I was missing Max, becoz of that i was getting null values.

Thanks alot.

Regards,
Basawareddy.


Hi Basawareddy,
In future please post questions as a new thread rather than hijacking old thread. This will increase visibility and you'll get solutions quicker.
Go to Top of Page

ssatjap1
Starting Member

4 Posts

Posted - 11/28/2011 :  10:40:16  Show Profile  Reply with Quote
Hello, I'm very new to SQL, and I am trying to figure out how to pivot the following table:

date ID Y/N
2/1 1 Y
2/2 2 N
2/3 3 NULL
etc..

I want to keep the dates as rows, make the ID as columns, and the Y/N as the value.

I have a very large data set, and I want to use the ID numbers as the column names.

For example:

Date 1 2 3
2/1 Y NULL NULL
2/2 NULL N NULL
2/3 NULL NULL NULL

etc.

I would appreciate anyone's help on this matter.

Thank you.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 11/28/2011 :  10:48:20  Show Profile  Reply with Quote
quote:
Originally posted by ssatjap1

Hello, I'm very new to SQL, and I am trying to figure out how to pivot the following table:

date ID Y/N
2/1 1 Y
2/2 2 N
2/3 3 NULL
etc..

I want to keep the dates as rows, make the ID as columns, and the Y/N as the value.

I have a very large data set, and I want to use the ID numbers as the column names.

For example:

Date 1 2 3
2/1 Y NULL NULL
2/2 NULL N NULL
2/3 NULL NULL NULL

etc.

I would appreciate anyone's help on this matter.

Thank you.


already replied in new thread

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous Page
 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.12 seconds. Powered By: Snitz Forums 2000