简体   繁体   English

只获取SQL表而不查看视图?

[英]Get SQL tables only not views?

SHOW TABLES

This lists the view also. 这也列出了视图。

But I don't want the view in the list. 但是我不希望列表中有该视图。

How can I write the Query and get that? 如何编写查询并获得查询?

I am using Mysql 5 and MyIsAm is my DB engine. 我正在使用Mysql 5,而MyIsAm是我的数据库引擎。

This should work: 这应该工作:

SELECT table_name FROM information_schema.tables WHERE table_type = 'BASE TABLE';

If you need to filter it based on schema, then you can add: 如果您需要基于架构对其进行过滤,则可以添加:

AND TABLE_SCHEMA = 'schema_name'

Take a look at the information_schema.tables table and you'll see other ways to filter the list. 看一看information_schema.tables表,您将看到其他过滤列表的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM