Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL CrossTab

Author  Topic 

cheatasp
Starting Member

10 Posts

Posted - 2009-05-13 : 22:41:05
Dear,

I have one problem with sql crosstab with image below



and I want to group by it only one row by column AssetCode,
Here is my code:

SELECT AssetCode,
(Case AssetItemID WHEN 1 THEN AssetDetail END) CPU,
(Case AssetItemID WHEN 2 THEN AssetDetail END) RAM,
(Case AssetItemID WHEN 3 THEN AssetDetail END) HDD,
(Case AssetItemID WHEN 4 THEN AssetDetail END) FDD,
(Case AssetItemID WHEN 18 THEN AssetDetail END) [CD/DVD],
(Case AssetItemID WHEN 9 THEN AssetDetail END) Monitor,
(Case AssetItemID WHEN 10 THEN AssetDetail END) UPS,
(Case AssetItemID WHEN 15 THEN AssetDetail END) Adapter,
(Case AssetItemID WHEN 7 THEN AssetDetail END) Mouse,
(Case AssetItemID WHEN 8 THEN AssetDetail END) Keyboard,
(Case AssetItemID WHEN 20 THEN AssetDetail END) CardReader,
(Case AssetItemID WHEN 13 THEN AssetDetail END) Bluetooth,
(Case AssetItemID WHEN 23 THEN AssetDetail END) InfraRed,
(Case AssetItemID WHEN 6 THEN AssetDetail END) BoardID
FROM TAB_AssetItemDetail
WHERE AssetCode='O1-6C-320-06-04'


please help me

Thanks

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-05-13 : 23:27:54
see http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=125655


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -