mysql查同个实例两个数据库中的表名差异

 

 

select
    TABLE_NAME
from (
    select 
         TABLE_NAME
        ,count(1) as cnt
    from information_schema.tables
    where TABLE_SCHEMA in ('db_a','db_b')
        and (table_name not like '%2018%' and table_name not like '%2019%')
    group by TABLE_NAME
) t1
where cnt <> 2
limit 50
;

 

posted @ 2019-08-28 14:30  chenzechao  阅读(598)  评论(0编辑  收藏  举报