zoukankan      html  css  js  c++  java
  • MYSQL 数据库名、表名、字段名查询

     //查询所有表的所有字段:

    select * from information_schema.columns where table_name='sys_users' 

     效果:

    //查询指定表的所有字段:

    select * from information_schema.columns where table_name='sys_users' and TABLE_SCHEMA='taoke'

    效果:

     //查询指定表的所有字段的指定类型,注释:

    查询所有含有此字段名的表:

    SELECT * FROM information_schema.columns WHERE column_name='name';

    查询指定数据库含有此字段名的表:

    SELECT * FROM information_schema.columns WHERE column_name='name' and TABLE_SCHEMA='wljdb';

    查询指定表数据库指定表的所有字段

    select column_name from information_schema.COLUMNS where table_name='sys_users' and TABLE_SCHEMA='taoke'

    查询指定表数据库指定表的第二个字段名:

    select column_name from information_schema.COLUMNS where table_name='sys_users' and TABLE_SCHEMA='taoke' LIMIT 1,1

    以上,举一反三

    ---------------------完毕----------------------------

     

    -----------------------------------------------------------------------------

      

  • 相关阅读:
    hdu2574 Hdu Girls' Day (分解质因数)
    python------logging模块
    python之异常
    python之反射
    python面向对象之封装
    python之面向对象2
    pyhton之路---面向对象
    python之路模块与包
    python常用模块
    匿名函数
  • 原文地址:https://www.cnblogs.com/Alwaysbecoding/p/6959262.html
Copyright © 2011-2022 走看看