Doug McNaught wrote:

It's false.  You can treat a view just like a table and add clauses to
your query that restrict it beyond what the view gives you.  I think
that's what you're asking about...

Thanks for your reply.


I found an example in the postgresql reference manual in the "CREATE VIEW" section that shows exactly what you said (reproduced below).

CREATE VIEW kinds AS
SELECT *
FROM films
WHERE kind = ’Comedy’;

The manual uses the view thusly:

SELECT * FROM kinds;

But what if the films table also had a field for the production company. This implies based on the view definition that it too, has the field (call it prod_co). Could I use the following query to select all Comedy films distributed by the 'Small Company' production company?

SELECT * FROM kinds WHERE prod_co = 'Small Company';

Yes this is contribed, but humor me please.

Shane


---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Reply via email to