RSS Forums RSS

make sth. like pivot with mssql 2000

Please support our MS SQL advertiser: Programming Forums
Reply
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

  #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!
AddThis Social Bookmark Button
Reply With Quote  
Posts: 1,867
Reputation: Ramy Mahrous has a spectacular aura about Ramy Mahrous has a spectacular aura about 
Solved Threads: 214
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Posting Virtuoso

Re: make sth. like pivot with mssql 2000

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Other Threads in the MS SQL Forum
Views: 531 | Replies: 1 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 10:46 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC