Currently I have this SQL which returns all spaces, their labels and how many times that label is used. This is great other than the fact that it also returns personal spaces. How can I tweak this SQL to filter out personal and only return global spaces?
spacename as "Space"
, name as "Label"
, count(name) as Count
left join LABEL
on CONTENT_LABEL.labelid = LABEL.labelid
left join CONTENT
I think, this is what you need:
select c.spaceid, s.spacename, l.name, count(l.name) as Count from content_label cl
join CONTENT c on c.contentid = cl.contentid
join label l on l.labelid = cl.labelid
join spaces s on s.spaceid = c.spaceid
where c.CONTENT_STATUS != 'deleted' and c.contenttype != 'SPACEDESCRIPTION' and s.spacetype != 'personal'
group by c.spaceid, s.spacename, l.name
order by count desc
Hey there, folks! For most of us, the past six months- yes, you read that right- have been a journey. More people than ever before have pivoted to working remotely, and navigating being on-scre...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events