Forum Discussion

Claudius's avatar
3 years ago

How to pull topic count per node by author? GROUP BY anyone?

Hi,

I would like to programmatically generate a list of authors on an idea board and their number of idea submissions using LiQL. In generic SQL I would simply GROUP BY author.id while pulling the board's messages. Unfortunately no such grouping seems to exist for LiQL. I was also looking at the boards collection, but no functionality seems to allow me to group message count by authors.

Worst case I would have to pull all messages on the board and count authors.

Does anyone have a solution for pulling message count per node by author? 

  • Hello Claudius,
    I just tried and confirm that GROUP BY is not possible in LiQL.

    So, the only option we have which you suggest above.

    use following LiQL:

    SELECT id, author.id FROM messages WHERE board.id = '<board-id>'

    And then count, author's article. 

    Regards,
    Abhishek Gupta