943,854 Members | Top Members by Rank

Ad:
  • MS SQL Discussion Thread
  • Unsolved
  • Views: 1089
  • MS SQL RSS
Jan 13th, 2009
0

make sth. like pivot with mssql 2000

Expand Post »
--query of a very large table
SELECT
abc AS 'productname',
xyz AS 'quantity'

INTO #tmptable

FROM
dfg

WHERE
blah

--
--content of #tmptable:
--productname quantity
--product1 5
--product2 3
--product1 2
--product2 8
--product1 5
--

how does a query on #tmptable look like, if I want to receive the following result?

productname quantity
product1 12
product2 11
???

thank you in advance!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
phantom.der.oma is offline Offline
1 posts
since Jan 2009
Jan 14th, 2009
0

Re: make sth. like pivot with mssql 2000

Featured Poster
Reputation Points: 480
Solved Threads: 276
Postaholic
Ramy Mahrous is offline Offline
2,189 posts
since Aug 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MS SQL Forum Timeline: Where is AlwaysUseDefaultCodePage?
Next Thread in MS SQL Forum Timeline: Copying ASP.NET's default member info database





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC