Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get only tables, not views using SHOW TABLES?

Tags:

mysql

SHOW TABLES gives you tables+views.

How do I retrieve only tables?

like image 616
Yeti Avatar asked May 25 '10 21:05

Yeti


People also ask

How do I get a list of tables in snowflake schema?

If you specify the keyword ACCOUNT , then the command retrieves records for all schemas in all databases of the current account. If you specify the keyword DATABASE , then: If you specify a <database_name> , then the command retrieves records for all schemas of the specified database.

Why do we use views instead of tables?

Views can provide advantages over tables: Views can represent a subset of the data contained in a table. Consequently, a view can limit the degree of exposure of the underlying tables to the outer world: a given user may have permission to query the view, while denied access to the rest of the base table.


1 Answers

show full tables where Table_Type = 'BASE TABLE' 

verbatim.

Or put another way;

show full tables where Table_Type != 'VIEW' 

http://dev.mysql.com/doc/refman/5.0/en/show-tables.html

like image 181
Francisco Soto Avatar answered Sep 19 '22 20:09

Francisco Soto