-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Using 'limit' with 'count' throws ProgrammingError #1509
Comments
The resulting query looks like this, which doesn't quite make sense: SELECT COUNT(1) FROM (
SELECT "t1"."id" FROM "whatever" AS "t1"
INTERSECT
SELECT "t2"."id" FROM "whatever" AS "t2"
) LIMIT 3 AS "_wrapped" Why are you applying a LIMIT and also using COUNT? |
Looks like this query works, however: SELECT COUNT(1) FROM (
SELECT "t1"."id" FROM "whatever" AS "t1"
INTERSECT
SELECT "t2"."id" FROM "whatever" AS "t2"
LIMIT 3
) AS "_wrapped" |
Fixed by 42d9642 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a long SQL query that throws a
ProgrammingError
. I've isolated it to the following query:Throws:
Tested on peewee-3.0.18 and peewee-3.0.19.
PS. This works correctly:
Is
len()
the canonical way to view the amount of rows returned?The text was updated successfully, but these errors were encountered: