#886 confirmed
szymon

Incorrect FROM-clause (postgres)

Reported by szymon | June 5th, 2009 @ 03:10 AM

This code:

http://gist.github.com/124145

gives us this kind of error:

http://gist.github.com/124146

query:

SELECT "articles"."id", "articles"."title" FROM "articles"
INNER JOIN "taggings" ON "tags"."id" = "taggings"."tag_id" INNER JOIN
"articles" ON "taggings"."article_id" = "articles"."id" WHERE "tags"."tag" = 'sometag' GROUP BY "articles"."id", "articles"."title" ORDER BY "articles"."id"

is invalid. should be (i think):

SELECT "articles"."id", "articles"."title" FROM "tags"
INNER JOIN "taggings" ON "tags"."id" = "taggings"."tag_id" INNER JOIN
"articles" ON "taggings"."article_id" = "articles"."id" WHERE "tags"."tag" = 'sometag' GROUP BY "articles"."id", "articles"."title" ORDER BY "articles"."id"

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket

Pages