oracle、sqlserver、mysql、postgresql查询所有视图名称
时间: 2023-12-07 21:03:10 浏览: 148
sqlserver,mysql,oracle三种数据库的分页查询
不同的数据库管理系统(DBMS)对应的SQL语句略有不同:
- Oracle:`SELECT view_name FROM all_views;`
- SQL Server:`SELECT name FROM sys.views;`
- MySQL:`SELECT table_name FROM information_schema.views;`
- PostgreSQL:`SELECT table_name FROM information_schema.views;`
注意,这些查询语句都是区分大小写的。如果你想要查询某个特定模式下的所有视图,可以在查询语句中添加模式名,例如:
- Oracle:`SELECT view_name FROM all_views WHERE owner = 'schema_name';`
- SQL Server:`SELECT name FROM sys.views WHERE schema_name = 'schema_name';`
- MySQL:`SELECT table_name FROM information_schema.views WHERE table_schema = 'schema_name';`
- PostgreSQL:`SELECT table_name FROM information_schema.views WHERE table_schema = 'schema_name';`
阅读全文