SELECT
(SELECT TOP 1 obj FROM rel_raci responsible_raci_r WHERE responsible_raci_r.PERSON_ID = organization.id AND responsible_raci_r.RACI ='R') AS responsible_inverted,
(SELECT TOP 1 obj FROM rel_raci responsible_raci_r WHERE responsible_raci_r.PERSON_ID = organization.id AND responsible_raci_r.RACI ='A') AS accountable_inverted,
(SELECT TOP 1 obj FROM rel_raci responsible_raci_r WHERE responsible_raci_r.PERSON_ID = organization.id AND responsible_raci_r.RACI ='C') AS consulted_inverted,
(SELECT TOP 1 obj FROM rel_raci responsible_raci_r WHERE responsible_raci_r.PERSON_ID = organization.id AND responsible_raci_r.RACI ='I') AS informed_inverted
FROM obj_resource organization
WHERE CONTAINS('2cef8e3d:15992b7f51e:33f', organization.id, -1) AND getOrgtype(organization.id) != 1
答案 0 :(得分:0)
您要问的一般语法是:
SELECT {columns_list}
FROM {table_name}
WHERE {column_name} IN (SELECT {column_name}
FROM {table_name}
WHERE {condition(s)}
) A ;