视图可以简化语句查询,控制数据访问。
首先练习一个数据查询简单视图。
#创建视图V_city_id CREATE VIEW V_city_id AS SELECT "public".city."id" FROM city; #CREATE VIEW #Query returned successfully in 322 msec. #使用视图 SELECT * FROM V_city_id; ```![简单视图](https://static.oschina.net/uploads/img/201710/18103028_QI7w.png "简单视图") 删除视图。
DROP VIEW V_city_id;