View Single Post
Join Date: Jan 2009
Posts: 1
Reputation: phantom.der.oma is an unknown quantity at this point 
Solved Threads: 0
phantom.der.oma phantom.der.oma is offline Offline
Newbie Poster

make sth. like pivot with mssql 2000

 
0
  #1
Jan 13th, 2009
--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!
Reply With Quote