DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   MS SQL (http://www.daniweb.com/forums/forum127.html)
-   -   make sth. like pivot with mssql 2000 (http://www.daniweb.com/forums/thread168049.html)

phantom.der.oma Jan 13th, 2009 8:19 am
make sth. like pivot with mssql 2000
 
--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!

Ramy Mahrous Jan 14th, 2009 1:09 am
Re: make sth. like pivot with mssql 2000
 
Have a look on http://sqlserver2000.databases.aspfa...vot-query.html


All times are GMT -4. The time now is 11:24 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC