Hi everyone,
I have an sql querry below:
select pkg.Name as [Package Name] , parent.Name as [Parent Name] , o.Name as [Name], o.Status as [Status]
FROM ((t_object o
inner join t_package pkg on pkg.Package_ID = o.Package_ID)
left join t_object parent on parent.Object_ID = o.ParentID)
where o.Package_ID IN (#Branch#)
and o.Object_Type = 'Class'
which returns all classes, their status and parent name. Just as expected.
What if I would want to return also a value of specific tag?
So as I am really not so confident with SQL, I tried searching on the forums and found something like:
select t_object.ea_guid AS CLASSGUID, t_object.Object_Type AS CLASSTYPE, t_object.Name, tag1.[Value], tag2.[Value]
from t_object, t_objectproperties tag1, t_objectproperties tag2
where t_object.Object_ID = tag1.Object_ID
and t_object.Object_ID = tag2.Object_ID
and tag1.[Property] = 'tag1'
and tag2.[Property] = 'tag2'
However I am having problems merging the 2 codes together (obvious problem, since I am not dealing with SQL on daily basis).
I tried something like:
select pkg.Name as [Package Name] , parent.Name as [Parent Name] , o.Name as [Name], o.Status as [Status], tag1.[Value]
FROM ((t_object o, t_objectproperties tag1
inner join t_package pkg on pkg.Package_ID = o.Package_ID)
left join t_object parent on parent.Object_ID = o.ParentID)
where o.Package_ID IN (#Branch#)
and o.Object_Type = 'Class'
and tag1.[Property] = 'Level'
But it yields a problem. I am not entirely sure if I understand the Inner join, left Join etc... so I assume I made a mistake over there.
Anyone could help me out?
Regards