表格查询的sql
查询表的SQL
select table_name tableName, engine, table_comment tableComment, create_time createTime from information_schema.tables
where table_schema IN( 'new_task','new_exp')
order by create_time desc
SELECT * FROM information_schema.tables WHERE table_schema ='new_exp'
select table_name tableName, engine, table_comment tableComment, create_time createTime from information_schema.tables
where table_schema = (select database()) and table_name = 't_feature_image'
select column_name columnName, data_type dataType, column_comment columnComment, column_key columnKey, extra from information_schema.columns
where table_name = 't_feature_image'
and table_schema = (select database()) order by ordinal_position
SELECT
sum(TABLE_ROWS) totalCount
FROM
`information_schema`.`tables`
WHERE
TABLE_NAME LIKE 't_table%'
https://www.cnblogs.com/lukcyjane/p/3849354.html
https://www.cnblogs.com/kazihuo/p/12168156.html
select table_schema,count(table_name) cou,group_concat(table_name)
from information_schema.tables
WHERE table_type ='BASE TABLE' AND table_schema NOT IN( 'information_schema','mysql','performance_schema','sys')
select CONCAT('select count(0) from ',table_schema,'.',table_name,';') from information_schema.`TABLES` WHERE table_type ='BASE TABLE' AND table_schema NOT IN( 'information_schema','mysql','performance_schema','sys')
SELECT
table_schema AS '数据库',
table_name AS '表名',
table_rows AS '记录数',
TRUNCATE (data_length / 1024 / 1024, 2) AS '数据容量(MB)',
TRUNCATE (index_length / 1024 / 1024, 2) AS '索引容量(MB)'
FROM
information_schema. TABLES
WHERE
table_type = 'BASE TABLE'
AND table_schema NOT IN (
'information_schema',
'mysql',
'performance_schema',
'sys'
)
ORDER BY
table_schema
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 通过 API 将Deepseek响应流式内容输出到前端
· AI Agent开发,如何调用三方的API Function,是通过提示词来发起调用的吗