sql question - Mailing list pgsql-novice

From Duncan Adams (DNS)
Subject sql question
Date
Msg-id 7DD34E6DF5CD1B4283DDAB96A855DCED2F322B@vodabemail1.vodacom.co.za
Whole thread Raw
List pgsql-novice
Hi all

Can anyone tell me if there is a way of doing the query bellow, do i have to
do 4 queries or is there a way of just doing one?

thanx in advance.


the following table tells me is who (per_key) is a systems manager,
administrator, second call out and hardware call out for a system.

         Table "per_sys"
 Attribute  |   Type   | Modifier
------------+----------+----------
 system_key | smallint |
 per_key    | smallint |
 man        | boolean  |
 admin      | boolean  |
 second     | boolean  |
 hard       | boolean  |


select
system.name as name,
personal.name ||' '|| personal.surname as name_man,
personal.name ||' '|| personal.surname as name_admin,
personal.name ||' '|| personal.surname as name_second,
personal.name ||' '|| personal.surname as name_hard
where
system.name IS NOT NULL and
per_sys.per_key != 0 and
((personal.key_personal = per_sys.per_key and per_sys.man = 't') or
(personal.key_personal = per_sys.per_key and per_sys.admin = 't') or
(personal.key_personal = per_sys.per_key and per_sys.second = 't') or
(personal.key_personal = per_sys.per_key and per_sys.hard = 't'))
order by system.name;

pgsql-novice by date:

Previous
From: "Joshua b. Jore"
Date:
Subject: Re: INSERT failing because of CONSTRAINT
Next
From: "Joseph Molnar"
Date:
Subject: Re: Question on oid's