how to build this query ??? Please help !!!

From: juerg(dot)rietmann(at)pup(dot)ch
To: pgsql-sql(at)postgresql(dot)org
Subject: how to build this query ??? Please help !!!
Date: 2001-01-03 15:17:19
Message-ID: OF1A29840D.F8821C77-ONC12569C9.00445CC1@pup.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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
============================================

Browse pgsql-sql by date

  From Date Subject
Next Message Nikolaj Lundsgaard 2001-01-03 15:40:54 Sv: how to build this query ??? Please help !!!
Previous Message Richard Huxton 2001-01-03 10:22:03 Re: Weird problem with script...