I have a table temp1 with the following data:
a b c d
10 11 888 991
10 11 888 992
How do I pivot this such that the output be
10 11 888 991 992
Thanks
harishWith the extremely limited information you've provided,
SELECT a,b,c,MIN(d),MAX(d)
FROM temp1
GROUP BY a,b,c
If you want a more complete answer, please provide a more complete question.
http://www.aspfaq.com/5006
"harish" <harish.prabhala@.gmail.com> wrote in message
news:1131137736.316980.221230@.g49g2000cwa.googlegroups.com...
>I have a table temp1 with the following data:
> a b c d
> 10 11 888 991
> 10 11 888 992
> How do I pivot this such that the output be
> 10 11 888 991 992
> Thanks
> harish
>|||Hey Thanks
But if i have more than 2 rows for one key (a,b,c) the this will not
work.
In that case how do I do it?|||> But if i have more than 2 rows for one key (a,b,c) the this will not
> work.
See how helpful more information would have been?
> In that case how do I do it?
http://www.aspfaq.com/2462
Again, if you want a more useful answer, provide a more detailed question.
See the link I posted in my previous response.|||Hey thanks a lot
that was helpful|||harish (harish.prabhala@.gmail.com) writes:
> But if i have more than 2 rows for one key (a,b,c) the this will not
> work.
> In that case how do I do it?
Books Online has a section on it:
Accessing and Changing Relational Data
Advanced Query Concepts
Transact-SQL Tips
Cross-Tab Reports
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||The more things change the more they remain then same:)
Check out THE Rac utility @.
www.rac4sql.net
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment