Received: from sysadmin.chi.wdr.com (sysadmin.chi.ubswarburg.com [146.180.1.66]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f047qh769473 for ; Thu, 4 Jan 2001 02:52:43 -0500 (EST) (envelope-from devin@sysadmin.chi.wdr.com) Received: from devin by sysadmin.chi.wdr.com with local (Exim 3.12 #2) id 14E5Cx-00014v-00; Thu, 04 Jan 2001 01:53:11 -0600 Date: Thu, 4 Jan 2001 01:53:05 -0600 (CST) From: Tod McQuillin X-X-Sender: To: Jens Hartwig cc: Nikolaj Lundsgaard , Subject: Re: Sv: how to build this query ??? Please help !!! In-Reply-To: <3A5423BB.C8C505FC@debis.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200101/45 X-Sequence-Number: 706 On Thu, 4 Jan 2001, Jens Hartwig wrote: > > SELECT a_nr, > > (SELECT count(*) FROM cylinders WHERE z_a_nr = a_nr) AS #cylinder, > > [...] > > FROM orders > > Is this a documented feature? Where can I find more information about > this? I do not want to join the actual discussion about documentation > of PostgreSQL but I never before have seen such a construct in SQL! Subqueries are covered in Bruce Momjian's book: http://www.postgresql.org/docs/aw_pgsql_book/node93.html I don't think the PostgreSQL User's Manual mentions sub-selects. -- Tod McQuillin