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 ;
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 ;