91-9990449935 0120-4256464 |
PostgreSQL ViewIn PostgreSQL, a VIEW is a pseudo table. It is not a physical table but appear as ordinary table to select. A view can also represent joined tables. It can contain all rows of a table or selected rows from one or more tables. A View facilitates users to do the following:
PostgreSQL Create ViewPostgreSQL view can be created by using CREATE VIEW statement. You can create it from a single table, multiple tables and another view. Syntax: PostgreSQL Create View ExampleConsider a table "EMPLOYEES", having the following data. Now, we create a view from "EMPLOYEES" table. This view would contain only few columns from EMPLOYEES table: Execute the following query: You can see this as: Now, you can retrieve data from the view "current_employees" as a simple query statement. You would see the following table: PostgreSQL DROP ViewFollow these steps:
You can also delete or drop a view by using the DROP VIEW command. Syntax: To delete the above example:
Next TopicPostgreSQL Join
|