Hi guys,
My query returns as below:
Computer Name | Make | Model | S/N | OU Name |
Hostname1 | Dell Inc. | Latitude E6400 | A123456 | DOMAIN.LOCAL/Computer |
Hostname1 | Dell Inc. | Latitude E6400 | A123456 | DOMAIN.LOCAL/Computer/OS |
Hostname1 | Dell Inc. | Latitude E6400 | A123456 | DOMAIN.LOCAL/Computer/Windows7 |
Now that was duplicate value for Hostname1.
I wanted the result for Hostname 1 to be unique, which only to display the longest character under column 'OU Name'
I'm using max as the following but the results didn't change much:
select Info.Computer_Name as 'Computer Name', Info.Make as 'Make', Info.Model as 'Model, Info.Serial_Number as 'S/N', max (Info.OU_Name) as 'OU Name' from ComputerInformation as Info group by Info.Computer_Name, Info.Make, Info.Model, Info.Serial_Number, Info.OU_Name
Please help me to achieve the desired results.
Thank you very much in advanced!
---Pat