|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Convert rows into columns
Hello,
I have a problem formatting some data. What I have so far is a query that returns me two columns. One is the name of some "assets" and the other is a count of all the assets associated with that name. eg servers 2 printers 25 CPU 700 What I need to do is convert the rows into columns. I want it to look like this: servers printers CPU 2 25 700 Here is the simple query that gets me my results: Select asset_cateogry, count(asset_category) from tableName group by asset_category I would also like to add a date range for the count but that is not my main problem right now. I am really new to SQL so any and all help is appreciated. Thanks in advance, Cam |
|
#2
|
||||
|
||||
|
If you are wanting to do this from within sql server, you can't, but you can format the data anyway you want after you retrieve it from the database.
|
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > Convert rows into columns |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|