make sth. like pivot with mssql 2000

Reply

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 Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: make sth. like pivot with mssql 2000

 
0
  #2
Jan 14th, 2009
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the MS SQL Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC