Received: from bjke.com (firewall-user@ganymede.bjke.com [144.210.8.38]) by hub.org (8.8.8/8.7.5) with ESMTP id MAA12482; Thu, 23 Jul 1998 12:15:33 -0400 (EDT) Received: by bjke.com; id LAA06522; Thu, 23 Jul 1998 11:15:24 -0500 (CDT) Received: from cpsmail.cpsgroup.com(144.210.12.11) by gauntlet.bjke.com via smap (4.1) id xmab06445; Thu, 23 Jul 98 11:15:17 -0500 Received: by cpsmail with Internet Mail Service (5.0.1458.49) id <3XAFWQZP>; Thu, 23 Jul 1998 11:17:17 -0500 Message-ID: From: "Jackson, DeJuan" To: M.Boekhold@et.tudelft.nl, Bruce Tong Cc: PostgreSQL General , pgsql-interfaces@postgreSQL.org Subject: RE: [GENERAL] ODBC Driver Date: Thu, 23 Jul 1998 11:17:16 -0500 X-Priority: 3 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.0.1458.49) Content-Type: text/plain > > SELECT contact.contact_lname, contact.contact_fname, > school.school_name > > FROM contact INNER JOIN school ON contact.contact_school = > > school.school_id; > > > > If I remember correctly, INNER JOIN is not yet supported in > PostgreSQL, > > which would explain the failure. Sorry to have accused the failure > on the > > Aren't INNER JOIN's not exactly the same as what we call a 'normal' > join? > ie. isn't it an idea to add the syntax of an INNER JOIN to the parser > and > just kinda ignore it? You could have the scanner return just a "," > (comma) > for the INNER_JOIN token.... > > Maarten > If it were only that easy it would have been implemented long ago. The 'join clause' syntax takes the form of tuple_struct(1) [AS alias(1)] tuple_struct(1) [AS alias(2)] ON column_contraints Where: tuple_struct = a table name, or the result of a 'join clause' JOIN_TYPE = INNER JOIN | -- Normal join LEFT [OUTER] JOIN | -- Includes all rows from tuple_struct(1) even if they do not satisfy the column_contraints (NULL padded) RIGHT [OUTER] JOIN | -- Includes all rows from tuple_struct(2) even if they do not satisfy the column_contraints (NULL padded) FULL OUTER JOIN -- Includes all rows from tuple_struct(1 & 2) even if they do not satisfy the column_contraints (NULL padded) constraint_type = Same form as a WHERE clause Which means you could easily have: SELECT * FROM ((t1 INNER JOIN t2 ON (t1.col1 = t2.col1 AND t1.name = t2.type)) AS j1 INNER JOIN (t3 INNER JOIN t4 ON (t3.col1 = t4.col1 AND t3.name = t4.type)) AS j2 ON j1.col1 = j2.col1) AS r1 WHERE r1.stuff = 17 AND r1.kind = 'those' ORDER BY r1.sortCol Which would have to be rewritten as: SELECT * FROM t1, t2, t3, t4 WHERE t1.col1 = t2.col1 AND t1.name = t2.type AND t3.col1 = t4.col1 AND t3.name = t4.type AND t1.col1 = t3.col1 AND t1.stuff = 17 AND t3.kind = 'those' ORDER BY t4.sortCol I say all this without a standard sitting in front of me and with no formal training so I want balk at correction if I missed a point or am misinformed, but this is what experience has told me. (Haven't ever actually tried that AS part of it though.) -DEJ