Hi all,
Could someone please help me how to modify below query to be able to list all the spaces with (ONLY) last page that is modified? at the moment the below query list all pages in all spaces with the date they each modified. I want to be able to see the only last page that is been modified.
Confluence server env not cloud and please note macros, plugins etc etc is not an option.
query:
SELECT s.spacekey,
c.title,
u.username AS Creator,
c.creationdate,
um.username AS LastModifier,
c.lastmoddate
FROM content c
JOIN spaces s ON c.spaceid = s.spaceid
JOIN user_mapping u ON c.creator = u.user_key
JOIN user_mapping um ON c.lastmodifier = um.user_key
WHERE c.prevver IS NULL
AND c.contenttype = 'PAGE'
AND c.content_status = 'current'
Order BY spacekey,title;
Thank you
I worked it out and thought to share my findings in case someone else stuck. hope this helps
SELECT s.spacekey,
c.title,
u.username AS Creator,
c.creationdate,
um.username AS LastModifier,
c.lastmoddate
FROM content c
JOIN spaces s ON c.spaceid = s.spaceid
JOIN user_mapping u ON c.creator = u.user_key
JOIN user_mapping um ON c.lastmodifier = um.user_key
WHERE c.prevver IS NULL
AND c.lastmoddate = (select max(c.lastmoddate) from content c where c.spaceid = s.spaceid and c.contenttype = 'PAGE' and c.content_status = 'current')
Order BY spacekey,title;
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.