zoukankan      html  css  js  c++  java
  • mysql常用sql语句

    1.根据表注释模糊查询对应的表:
    select table_name,table_comment from information_schema.tables where table_comment like '%业务归属%';
    2.查询指定库拥有某字段的表
    columnName 字段名   dbName 数据库名
    AND TABLE_NAME NOT LIKE 'vw%'  排除视图
    select distinct table_name from information_schema.columns where column_name = 'columnname' and table_schema='dbname' and table_name not like 'vw%';
    3.查询指定数据库所有的表名
    select table_name from information_schema.tables where table_schema='dbName' and table_type='base table';
    4.查询指定数据库没有某字段的所有表
    select table_name from information_schema.tables where table_schema='dbname' and table_type='base table'
    and table_name not in(
        select distinct table_name  from information_schema.columns where column_name = 'culumnname' and table_schema='dbname' and table_name not like 'vw%'
    );
    
    --1.查看那些表锁到了
    show OPEN TABLES where In_use > 0;
    --2.查看进程号
    show processlist;
    --3.杀死进程
     kill 1085850;
    
  • 相关阅读:
    第六章学习小结
    malloc iOS
    iOS事件传递机制
    对 runloop 的理解
    深恶痛绝重写setter和getter
    数据库常见问题总结
    iOS多应用自动打包
    一段文字中包含多种语言时行间距问题
    一个成熟应用的排版方案
    Flask纪要
  • 原文地址:https://www.cnblogs.com/khtt/p/15272491.html
Copyright © 2011-2022 走看看