1、查询表名及注释
SELECT TABLE_NAME AS '表名',TABLE_COMMENT AS '表注释' FROM INFORMATION_SCHEMA.Tables WHERE table_schema = 'prod'
2、根据列名或者表注释搜索表
SELECT TABLE_NAME FROM information_schema.COLUMNS WHERE COLUMN_NAME IN ( 'name','student' ))
and TABLE_NAME not like '%2022%'
3、通过关键字综合检索表名
SELECT TABLE_NAME AS '表名',TABLE_COMMENT AS '表注释' FROM INFORMATION_SCHEMA.Tables WHERE table_schema = 'prod'
AND TABLE_NAME IN (
SELECT TABLE_NAME FROM information_schema.COLUMNS WHERE COLUMN_NAME IN ( 'name','student' ))
and TABLE_NAME not like '%system_log%' and TABLE_NAME not like '%2022%'
4、MYSQL设置某个字段时间默认取当前时间
CURRENT_TIMESTAMP