Skip to content
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

fixed GROUP BY issue with expressions #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dbaldy
Copy link

@dbaldy dbaldy commented Sep 22, 2020

Fixed this issue: #12

It was due to a specificity of MSSQL used through pyodbc that doesn't allow using a column in an expression without referring to it in the GROUP BY clause.

In other terms, this is not allowed with MSSQL's sp_prepexec:
SELECT id, F(a) FROM ... GROUP BY id, F(a)

But should instead be:
SELECT id, F(a) FROM ... GROUP BY id, F(a), a

The PR should be compatible with 2.2, 3.0 and 3.1.

@OskarPersson
Copy link
Collaborator

Please rebase this and fix the failing tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants