I need to create a report that show all spaces and their space types from the people directory. I have found out, that I need to include the database tables AO_DF3C2B_SPACE_LABEL and AO_DF3C2B_SUPER_LABEL, but I need to add them to my SQL query. Can you help?
Hey there! Thank you for getting in touch. I had a look at the database and this query should do the trick.
SELECT
spaces.spacename,
"AO_DF3C2B_SUPER_LABEL"."TITLE"
FROM
spaces,
label,
content_label,
"AO_DF3C2B_SPACE_LABEL",
"AO_DF3C2B_SUPER_LABEL"
WHERE
spaces.spacedescid = content_label.contentid
AND
label.namespace = 'team'
AND
content_label.labelid = label.labelid
AND
"AO_DF3C2B_SPACE_LABEL"."TITLE" = label.name
AND
"AO_DF3C2B_SPACE_LABEL"."SUPER_LABEL_ID" = "AO_DF3C2B_SUPER_LABEL"."ID";
This will give you all spaces and their types.
spacename | name | TITLE
-----------+----------------+---------------
test | my space label | My space type
(1 row)