Skip to content
New issue

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

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

Already on GitHub? # to your account

select(distinct=...) may produce faulty sql for sqlite #1129

Closed
pembeci opened this issue Dec 15, 2015 · 2 comments
Closed

select(distinct=...) may produce faulty sql for sqlite #1129

pembeci opened this issue Dec 15, 2015 · 2 comments

Comments

@pembeci
Copy link

pembeci commented Dec 15, 2015

This one works:

In [45]: db().select(db.player.country, distinct = True)
Out[45]: <Rows (40)>

In [46]: db._lastsql
Out[46]: 'SELECT DISTINCT player.country FROM player;'

But the other option given in the book does not:

In [47]: db().select(db.player.country, distinct = db.player.country)
OperationalError: near "ON": syntax error

In [48]: db._lastsql
Out[48]: 'SELECT DISTINCT ON (player.country) player.country FROM player;'

I didn't test it with other DB engines since I don't currently have one installed.

@pembeci pembeci changed the title select(distinct=...) may produce faulty sql for sqlite select(distinct=...) may produce faulty sql for sqlite Dec 15, 2015
@cassiobotaro
Copy link
Contributor

@gi0baro I think it's pydal related.

@gi0baro gi0baro added bug and removed bug labels Dec 18, 2015
@gi0baro
Copy link
Member

gi0baro commented Dec 18, 2015

@cassiobotaro yep seems to me too. Can you open up an issue on pyDAL?

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

No branches or pull requests

4 participants