Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id 0AF9A2E0030 for ; Wed, 9 Apr 2008 02:33:59 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 52855-10 for ; Wed, 9 Apr 2008 02:33:51 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mailserver.ttmail.com (unknown [88.255.235.9]) by developer.postgresql.org (Postfix) with ESMTP id AB78A2E007B for ; Wed, 9 Apr 2008 02:33:51 -0300 (ADT) Received: from SMTP2 ([192.168.19.137]) by mailserver.ttmail.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 9 Apr 2008 08:33:29 +0300 Received: from alamut.mobiliz.com.tr ([213.139.194.86]) by SMTP2 with Microsoft SMTPSVC(6.0.3790.1830); Wed, 9 Apr 2008 08:33:28 +0300 Received: from (unknown [213.139.194.86]) by AVGW-TTMAIL-4.ttmail.com with smtp id 0da4_796f7f80_05f6_11dd_9e25_001422175f2f; Wed, 09 Apr 2008 08:33:27 +0300 From: Volkan YAZICI To: novice Cc: pgsql-sql@postgresql.org Subject: Re: count question References: Date: Wed, 09 Apr 2008 08:37:50 +0300 In-Reply-To: (novice's message of "Wed, 9 Apr 2008 11:51:35 +1000") Message-ID: <87ej9fr3kh.fsf@alamut.mobiliz.com.tr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-NAI-Spam-Report: 0 Rules triggered X-OriginalArrivalTime: 09 Apr 2008 05:33:29.0052 (UTC) FILETIME=[3DAF09C0:01C89A03] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/57 X-Sequence-Number: 30596 On Wed, 9 Apr 2008, novice writes: > Is it possible to write a query to produce: > > meter_id | no_of_bays | bay_id > ----------+------------+----------- > 5397 | 2 | 5397-01 > 5397 | 2 | 5397-02 > 5409 | 3 | 5409-01 > 5409 | 3 | 5409-02 > 5409 | 3 | 5409-03 Shouldn't this function be the responsitibility of client software, instead of database? Regards.