Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article explains how how to find a Confluence user the favorites list by of all Confluence users using the SQL for Confluence app.

Instructions

  1. The following query provides data for the users with the list of their respective favorite pagesIn a Confluence page, search for the SQL Query macro or enter {sql and select the macro.
  2. Enter the following query in the macro and select Output format as Wiki:

    Code Block
    themeMidnight
    SELECT u.username, c.title FROM label l, content_label t, content c, user_mapping u WHERE l.labelid=t.labelid AND t.contentid=c.contentid AND t.owner = u.user_key;


The query retrieves a list of all users along with their respective favorite pages. The output of the above query is as

...

follows:

...

Image Added

Info
This example is from the PostgreSQL databaseThe query used in this example was written for PostgreSQL database. You may need to modify the query depending on the database used in your organization.