开发者

Get SQL tables only not views?

开发者 https://www.devze.com 2023-01-21 03:50 出处:网络
SHOW TABLES This lists the view 开发者_StackOverflowalso. But I don\'t want the view in the list. How can I write the Query and get that?

SHOW TABLES

This lists the view 开发者_StackOverflowalso.

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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消