New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails for multiple aggregating functions #108

Closed
ahw opened this Issue Nov 20, 2013 · 0 comments

Comments

Projects
None yet
1 participant
@ahw

ahw commented Nov 20, 2013

When trying to build this valid SQL, Knex throws an error.

SQL:

SELECT
    COUNT(foo),
    COUNT(bar)
FROM table_name
GROUP BY baz;

JavaScript:

Knex.knex('table_name')
    .count('foo')
    .count('bar')
    .groupBy('baz');

// => Error: "The query type has already been set to select"

tgriesser added a commit that referenced this issue Nov 25, 2013

Merge branch 'master' of github.com:tgriesser/knex
* 'master' of github.com:tgriesser/knex:
  Test for aggregate function with output name.
  Support for multiple aggregate functions.
  Failing test for #108
  Drop default output name for aggregate functions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment