X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 4B3C947592C for ; Fri, 21 Feb 2003 08:54:47 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 84163-08 for ; Fri, 21 Feb 2003 08:54:36 -0500 (EST) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id A436B4753A1 for ; Fri, 21 Feb 2003 08:54:32 -0500 (EST) Received: by news.hub.org (Postfix, from userid 8) id 885AC43A857; Fri, 21 Feb 2003 08:54:32 -0500 (EST) From: Alan Gutierrez X-Newsgroups: comp.databases.postgresql.sql Subject: Re: good style? Date: Fri, 21 Feb 2003 13:54:32 +0000 (UTC) Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 29 Message-ID: References: <3E5629EE.6000406@polonium.de> X-Complaints-To: usenet@news.hub.org User-Agent: slrn/0.9.7.4 (Linux) To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new X-Archive-Number: 200302/478 X-Sequence-Number: 11876 In article <3E5629EE.6000406@polonium.de>, Rafal Kedziorski wrote: > hi, > > I have 8 tables and this query: > > select u.users_id, m.name as mandant_name, u.login_name, u.password, > u.first_name, u.last_name, u.creation_date, g.name as groups_name, > ae.acl_entry_id, a.name as acl_name, p.name as permission_name > from mandant m, users_2_groups u2g, groups g, users u, permission p, > acl a, acl_entry ae, groups_2_acl_entry g2ae > where m.mandant_id = u.mandant_id and > u2g.groups_id = g.groups_id and > u2g.users_id = u.users_id and > g2ae.groups_id = g.groups_id and > g2ae.acl_entry_id = ae.acl_entry_id and > ae.acl_id = a.acl_id and > ae.permission_id = p.permission_id > > I'm not using JOIN for get this information. would be JOIN a better sql > programming style? faster? Better style, yes. Whitespace would help also. Faster, maybe. If you use join clauses you will be able to take control over your query, specifying what gets joined when. -- Alan Gutierrez - ajglist@izzy.net http://khtml-win32.sourceforge.net/ - KHTML on Windows