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.
Author |
Topic |
cheatasp
Starting Member
10 Posts |
Posted - 2009-05-13 : 22:41:05
|
Dear,I have one problem with sql crosstab with image belowand 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) BoardIDFROM TAB_AssetItemDetailWHERE AssetCode='O1-6C-320-06-04'please help meThanks |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
|
|
|
|