Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 0D1C547592C for ; Tue, 19 Nov 2002 01:47:04 -0500 (EST) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id A5CB44753A1 for ; Tue, 19 Nov 2002 01:47:03 -0500 (EST) Received: by news.hub.org (Postfix, from userid 8) id 9205643A567; Tue, 19 Nov 2002 01:47:03 -0500 (EST) From: ernest_it@hotmail.com (ernest_it@hotmail.com) X-Newsgroups: comp.databases.postgresql.sql Subject: create index Date: 18 Nov 2002 22:44:05 -0800 Organization: http://groups.google.com/ Lines: 15 Message-ID: <10d6eb7c.0211182244.ec57100@posting.google.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: groups-abuse@google.com To: pgsql-sql@postgresql.org X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/265 X-Sequence-Number: 10407 i don't know how to create the index about the following statement. SELECT b.screen_id AS screen_id, b.name AS screen_name FROM tbl_showlog AS a CROSS JOIN tbl_screen AS b CROSS JOIN tbl_company AS c WHERE a.screen_id = b.screen_id AND b.company_id = c.company_id AND c.company_id = 1 AND c.is_active = 1 GROUP BY b.screen_id, b.name ORDER BY b.screen_id many thx!