| | |
make sth. like pivot with mssql 2000
Please support our MS SQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jan 2009
Posts: 1
Reputation:
Solved Threads: 0
--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!
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!
Have a look on http://sqlserver2000.databases.aspfa...vot-query.html
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
![]() |
Other Threads in the MS SQL Forum
- Previous Thread: Where is AlwaysUseDefaultCodePage?
- Next Thread: Copying ASP.NET's default member info database
| Thread Tools | Search this Thread |






