Views

From: Bob Pawley <rjpawley(at)shaw(dot)ca>
To: Postgre General <pgsql-general(at)postgresql(dot)org>
Subject: Views
Date: 2005-12-17 23:39:02
Message-ID: 00bc01c60363$0fe80f70$ac1d4318@OWNER
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a table, Devices, with various values under the column Type.

I wish to view all of the information regarding two of these values 'monitor' and 'valve'.

The following gives me the information, but the rows are duplicated from one to three times. I would like to see one row for each of the values. I have attempted a number of variations but they all give me similar duplication.

Is this duplication due to the action of postgre as to the information I've entered into the tables , or is it due to the structure of the command?

If it is due to the command perhaps you can suggest a remedy.

Bob

------
create view p_id.trial
(P_ID_ID, Pipe_ID, Equipment_ID, Fluid_ID, Fluid, Type_, Function_, Device_ID, Device_Number, Association)
as select devices.p_id_id, pipe_id, equipment_id, process.fluid_id, process.fluid, devices.type_, devices.function_, device_id, device_number, devices.association
from p_id.devices, p_id.process
where devices.type_ = 'monitor'
or devices.type_ = 'valve'
and devices.fluid_id = process.fluid_id ;

Responses

  • Re: Views at 2005-12-18 00:09:00 from Michael Fuhr

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2005-12-18 00:09:00 Re: Views
Previous Message Tom Lane 2005-12-17 22:01:15 Re: is this a bug or I am blind?