Ticket #775 (closed Patch: duplicate)
Joining Multiple Tables with Postgres Driver
| Reported by: | Jeffrey04 | Owned by: | zombor |
|---|---|---|---|
| Priority: | major | Milestone: | 2.2.1 |
| Component: | Libraries:Database | Version: | 2.2 Release |
| Keywords: | Cc: |
Description
I don't have a fix for this at the moment. While joining 2 tables is fixed in #774, but when I am working on joining 3 tables, i get a query like this.
SELECT "v"."value"
FROM users u JOIN "profile_values v", "profile_fields f" ON (u.uid = v.uid) AND (f.fid = v.fid)
WHERE "uid" = '1'
AND "profile_organization" = 'organization'
As far as i know, postgres (8.3) doesn't work this way. A proper join statement should look something like
SELECT f.name, v.value
FROM users u
JOIN
("profile_values" v JOIN "profile_fields" f ON f.fid = v.fid)
ON v.uid = u.uid
WHERE u.uid = 1;
Change History
Note: See
TracTickets for help on using
tickets.
