• 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;
    
  • 相关阅读:
    小三学算术
    The Balance
    扫描线
    2019牛客暑期多校训练营(第九场)
    后缀数组
    Manacher
    局部变量和全局变量的区别
    2386:Lake Counting-poj
    简单背包问题(0032)-swust oj
    编程中易犯错误集锦-持续更新。。。。。
  • 原文地址:https://www.cnblogs.com/khtt/p/15272491.html
Copyright © 2020-2023  润新知