[racktables-users] SQL query question: Multiple attribute values with one query

Hello,

can anyone explain to me how I have to write an SQL query that returns
multiple attribute values?
I want to get all servers with Windows as operating system need addtional
information From AttributeValue.
The query should return:
RackObject.id, RackObject.name, RackObject.comment and from AttributeValue:
 * operating system
 * contact person
 * HW type

To get all servers with Windows as os I wrote this query:
[sql]
SELECT RackObject.id, RackObject.name, RackObject.comment,
REPLACE(Dictionary.dict_value,"%GPASS%"," ")
FROM AttributeValue
INNER JOIN RackObject ON AttributeValue.object_id = RackObject.id
LEFT JOIN Dictionary ON Dictionary.dict_key = AttributeValue.uint_value
WHERE AttributeValue.attr_id IN (10) OR Dictionary.dict_value LIKE
"%Windows%" ORDER BY RackObject.id
[/sql]

But I couldn't figure out how to get the other values within this query.

Thanks

Fabian aka Killsystem


Other related posts: