My query looks like this:
select SMS_G_System_COMPUTER_SYSTEM.Manufacturer, SMS_G_System_COMPUTER_SYSTEM.Model from SMS_R_System inner join SMS_G_System_COMPUTER_SYSTEM on SMS_G_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceId group by SMS_G_System_COMPUTER_SYSTEM.Manufacturer, SMS_G_System_COMPUTER_SYSTEM.Model
Which returns a list that looks similar to this:
Manufacturer | Model |
Dell Inc. | Latitude E6500 |
Dell Inc. | OptiPlex 760 |
Hewlett-Packard | HP Z800 Workstation |
Hewlett-Packard | HP Elite 7100 Microtower PC |
IBM | 8215EKU |
IBM | 8215E7U |
LENOVO | 8808CTO |
LENOVO | 9964ABU |
As soon as I add a count function:
select SMS_G_System_COMPUTER_SYSTEM.Manufacturer, SMS_G_System_COMPUTER_SYSTEM.Model, COUNT(*) as Quantity from SMS_R_System inner join SMS_G_System_COMPUTER_SYSTEM on SMS_G_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceId group by SMS_G_System_COMPUTER_SYSTEM.Manufacturer, SMS_G_System_COMPUTER_SYSTEM.Model
It fails. Can anyone tell me how to add a third "Quantity" Column onto the table above?
- Edited by Duct tape and super glue Friday, January 20, 2012 5:24 PM