Skip to content

Unable to get correct total on query with GROUP BY #192

Description

@Hendribcg

Create a custom query with GROUP BY clause, it will return false number as total
As the current SQL query to get the total number of row is by using a count statement in SQL select, if we are using GROUP BY in our SQL it will return the count in the grouped rows instead of total row count. My workaround solution is by extending the _find function and adding _clearGrouping('group');
in the query for getting count numbers.

Expected behavior

Return count of total row not the count of grouped row.

Actual behavior

It return count of grouped row.

System configuration

Tell us about the applicable parts of your setup.

Module versions (especially the part that's not working): feathers-knex 5.0.4, knex 0.16.3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions