sql怎么查询所有表

是这样的,想请讲解下,sql怎么查询所有表
最新回答
佐佐木惠理

2025-02-24 04:10:12

使用show tables语句就可以显示当前数据库中所有的表。

查找所有表的具体语句的例子如下:

1、select table_name 

from information_schema.tables 

where table_schema='当前数据库'

2、select name from SysObjects where type='u'

扩展资料

查询指定数据库中指定表的所有字段名,例如:column_name

select column_name from information_schema.columns 

where table_schema='csdb' and table_name='users'

查询的其他语句:

select * from all_col_comments –查询所有用户的表的列名和注释。

select * from user_col_comments – 查询本用户的表的列名和注释 。

select * from all_tab_columns –查询所有用户的表的列名等信息(详细但是没有备注)。

select * from user_tab_columns –查询本用户的表的列名等信息(详细但是没有备注)。

参考资料:

百度百科-sql语句大全