Groups | Blog | Home
all groups > sql server programming > august 2003 >

sql server programming : Query doubt


Satish
8/11/2003 11:43:42 PM
Hi All,
I have a query which returns rows like this:
Week Year Name Amt
15 2003 Name01 35.0
20 2003 Name02 8.0
15 2003 Name03 36.0
16 2003 Name04 2.0
15 2003 Name04 20.0
13 2003 Name05 3.0
14 2003 Name05 3.5
15 2003 Name05 6.25
16 2003 Name05 4.0
17 2003 Name05 5.0
18 2003 Name05 9.25
19 2003 Name05 3.75

Can I reformulate the query to accomplish the result in
this way.
Name01 Name02 Name03 Name04 Name05
13 2003 3.0
14 2003 3.5
15 2003 35.0 36.0 20.0 6.25
16 2003 2.0 4.0
17 2003 5.0
18 2003 9.25
19 2003 3.75
20 2003 8.0

Right now I am doing it through more than 2 queries.
Is it possible to do it in a single query.

Thanks in advance
John Bell
8/12/2003 8:02:41 AM
Hi

The following gives a list of links for crosstab queries:

http://tinyurl.com/i9mt

John

[quoted text, click to view]

AddThis Social Bookmark Button