Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

SQL help needed: Confluence query on page count per parent heading in specific space

Kelly Parr
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 1, 2018

Environment: Confluence server 6.2.3, PostgreSQL 9.4.4

I'm trying to get a page count, per top-level section in a Confluence space.

My SQL is rusty--getting only a total count of pages in the target space, when what I want to do is break it out by parent sections in the page tree.

db=# SELECT 
COUNT(title) AS pages,
parentccid
FROM content
WHERE spaceid = 12345
AND contenttype = 'PAGE'
GROUP BY parentccid;

 pages | parentccid
-------+------------
  1555 |           
(1 row)

 

Edit: I have found the Confluence data model for our version of Confluence, but I don't know what the column name is for a first-level heading in the page tree. Is that just another title (page)?

Here's a visual. I am looking for page counts grouped by (rolled up to?) each main parent page.

count.png

1 answer

0 votes
Kelly Parr
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 2, 2018

...

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events