zoukankan      html  css  js  c++  java
  • 查询数据库中所有表名,查询表中所有字段名

    mysql:

    1.查询数据库中所有表名称:

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

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

    2.查询每张表中所有字段名:

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

    oracle:

    1.查询数据库中所有表名称:

      select t.table_name from user_tables t;

    2.查询每张表中所有字段名:

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

  • 相关阅读:
    计算机组成原理
    爬取斗图
    视频爬取
    经典段子爬取
    爬取哈哈笑话
    爬取昵图网
    爬取校花网
    python操作docker
    正则表达式
    UUID
  • 原文地址:https://www.cnblogs.com/irishua/p/11430928.html
Copyright © 2011-2022 走看看