查询数据库中全部表名,查询表中全部字段名

mysql:html

1.查询数据库中全部表名称:mysql

  select table_name from information_schema.tables where table_schema='数据库名称';(包含视图)sql

  select table_name from information_schema.tables where table_schema='数据库名称' and table_type = 'BASE TABLE' AND table_schema = DATABASE ();(不包含视图)数据库

2.查询每张表中全部字段名:oracle

  select COLUMN_NAME from INFORMATION_SCHEMA.Columns where table_name='表名称' and table_schema='数据库名称';post

oracle:orm

1.查询数据库中全部表名称:htm

  select t.table_name from user_tables t;blog

2.查询每张表中全部字段名:io

  SELECT COLUMN_NAME FROM USER_TAB_COLUMNS WHERE TABLE_NAME = '表名称';

转载于:https://www.cnblogs.com/irishua/p/11430928.html