Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-10189

ORDER BY COUNT does not work with XWQL

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.1
    • Fix Version/s: 6.0-rc-1
    • Component/s: Query
    • Labels:
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      This XWQL request :

         select topic.author, count(topic.author)
           from Document doc, doc.object(MailArchiveCode.MailTopicClass) as topic
          where doc.space<>'MailArchiveCode'
       group by topic.author
       order by count(topic.author) desc
      

      ... will throw an org.xwiki.query.jpql.parser.ParserException exception when executed.

      This does not work better :

         select topic.author, count(topic.author)
           from Document doc, doc.object(MailArchiveCode.MailTopicClass) as topic
          where doc.space<>'MailArchiveCode'
       group by topic.author
       order by 2 desc
      

      In JPQL this would be allowed normally, and it could be useful to have it in XWQL.

        Attachments

          Activity

            People

            • Assignee:
              gdelhumeau Guillaume Delhumeau
              Reporter:
              jbousque Jeremie BOUSQUET
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: