How to list the users favourite pages and spaces
Purpose
The query below will list all the users favourite pages and spaces. The entries in the result which does not have page title are favourite spaces .
Solution
SELECT USER_MAPPING.username,content.spaceid,content.title ,spaces.spacekey,spaces.spacename
FROM LABEL
JOIN USER_MAPPING
ON LABEL.owner = USER_MAPPING.user_key
LEFT JOIN CONTENT_LABEL
ON LABEL.LABELID = CONTENT_LABEL.LABELID
JOIN CONTENT
ON CONTENT_LABEL.CONTENTID = CONTENT.CONTENTID
JOIN SPACES
ON CONTENT.spaceid = spaces.spaceid
WHERE LABEL.NAME='favourite'
Last modified on Jun 1, 2016
Powered by Confluence and Scroll Viewport.