zoukankan      html  css  js  c++  java
  • 数据库小记:根据指定名称查询数据库表名及根据指定名称查询数据库所有表中的字段名称(支持mysql/postgre)

    注意:本篇文章仅适用于mysql和postgre这两种数据库

    1、查询数据库中所有表名及对应表的详细信息

    select * from INFORMATION_SCHEMA.tables

    2、根据指定名称查询表名(也可模糊查询,可查询表的详细信息)

    select *  from INFORMATION_SCHEMA.tables where table_name = 'eguid';

    select * from INFORMATION_SCHEMA.tables where table_name like '%eguid%'; 

    3、查询数据库中所有表中的字段

    select * from INFORMATION_SCHEMA.columns

    4、根据指定名称查询任意表中对应的字段和表信息

    select * from INFORMATION_SCHEMA.columns where COLUMN_NAME = 'eguid';

    select * from INFORMATION_SCHEMA.columns where COLUMN_NAME Like '%eguid%';





  • 相关阅读:
    Chp18: Hard
    内存泄漏 和 内存溢出
    Chp4: Trees and Graphs
    trie树--详解
    Tries
    Comparable & Comparator
    memory leak
    8个月从CS菜鸟到拿到Google Offer的经历+内推
    Word Ladder II
    Java垃圾回收机制
  • 原文地址:https://www.cnblogs.com/eguid/p/10195568.html
Copyright © 2011-2022 走看看