September 24, 2009 at 10:09 pm
Hello,
I have a table ITEM_MST
ITEM_TYPE QTY Date
1 2 15 July 2009
1 4 16 July 2009
2 3 17 July 2009
2 1 18 July 2009
1 4 19 July 2009
1 6 20 July 2009
1 2 21 July 2009
I wan the output in this format
ITEM_TYPE QTY1 QTY2 QTY3
1 2 4 4
1 6 2
2 3 1
I dont want to use any aggregate functions as there is nothing to aggregate.
Please let me know the solution for the same ASAP.
Thanks and Regards
Rahul
September 25, 2009 at 1:58 am
I'm not sure I've understood you - do you need 2 rows for product type 1?
Otherwise, see the info about the PIVOT operator in BOL and also http://articles.techrepublic.com.com/5100-10878_11-6143761.html.
September 25, 2009 at 8:24 am
The best resources I've found for this are in the last 2 articles linked in my signature.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
September 25, 2009 at 11:41 am
Thanks, Jack. I added the links to my briefcase.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply