Received: from srvlnx02.pup.ch (br-d-75.agrinet.ch [212.28.129.75]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f03FE6790076 for ; Wed, 3 Jan 2001 10:14:06 -0500 (EST) (envelope-from juerg.rietmann@pup.ch) Subject: how to build this query ??? Please help !!! To: pgsql-sql@postgresql.org X-Mailer: Lotus Notes Release 5.0.5 September 22, 2000 Message-ID: From: juerg.rietmann@pup.ch Date: Wed, 3 Jan 2001 16:17:19 +0100 X-MIMETrack: Serialize by Router on srvlnx02/Pup/ch(Release 5.0.5 |September 22, 2000) at 01/03/2001 04:17:25 PM MIME-Version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.postgresql.org id f03FE9790080 X-Archive-Number: 200101/30 X-Sequence-Number: 691 Hello there I have a problem, building a query. Who can help ? I use postgreSQL 7.0.3. Thanks for any help and suggestions ... jr orders a_nr ¦ product ¦ state ----------------------------- 11 ¦ tp ¦ aaaa 12 ¦ fi ¦ bbbb 13 ¦ tp ¦ cccc 14 ¦ ok ¦ eeee 15 ¦ dm ¦ aaaa cylinders z_a_nr ¦ z_status ------------------------------ 11 ¦ zdr 11 ¦ zdr 12 ¦ zdr 12 ¦ zcu 13 ¦ zdr 13 ¦ zcu 13 ¦ zcu 13 ¦ zcr 15 ¦ zcu 15 ¦ zcu 15 ¦ zdr I need a query for the following output : a_nr ¦ #cylinder #zdr #zcu #zcr product state ---------------------------------------------------------------------- 11 2 2 0 0 dm aaaa 12 2 1 1 0 tp aaaa 13 4 1 2 1 fi bbbb 14 0 0 0 0 ok eeee 15 3 1 2 0 dm aaaa ============================================ PFISTER + PARTNER, SYSTEM - ENGINEERING AG Juerg Rietmann Grundstrasse 22a 6343 Rotkreuz Switzerland phone: +4141 790 4040 fax: +4141 790 2545 mobile: +4179 211 0315 ============================================