Re: Hidden Select - Mailing list pgsql-sql

From Peter Eisentraut
Subject Re: Hidden Select
Date
Msg-id Pine.LNX.4.30.0106111834060.756-100000@peter.localdomain
Whole thread Raw
In response to Re: Hidden Select  (Luis Sousa <llsousa@ualg.pt>)
List pgsql-sql
Luis Sousa writes:

> Suposing your example:
>
> Now i want to do a query to the view like this:
>
> SELECT * FROM C WHERE id=1;
>
> I whant to chose the id, but that id isn't in my select list !!!?????

Then you will have to define your view differently.

> > Do you mean like this?
> >
> > create table A (id int, content text);
> > create table B (id int, stuff numeric);
> > create view C as select A.content, B.stuff from A, B where A.id = B.id;

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter



pgsql-sql by date:

Previous
From: Alex Pilosov
Date:
Subject: Re: Table design issue....
Next
From: "Michael Richards"
Date:
Subject: finding a maximum or minimum sum