MySQL 查询返回、Schema_Name、Table_NAme、Count、Size_of_Table、Primary_Key 和 Auto_Increment_Key
我正在尝试解决另一个棘手的 MySQL 查询。我需要一个查询,该查询将在单个命令中返回以下内容:
+----------+------------------------------+-----------+-------------+----------------+--------------------+
| Database | Table_Name | Count | Size | Primary-Key | Auto_Increment_Key |
+----------+------------------------------+-----------+-------------+----------------+--------------------+
| mydb | account_length | 2408 | 0.04 Mb | account_id | account_id |
| mydb | account_log | 1225 | 0.09 Mb | log_id | NULL |
我对 MySQL 仍然是新手。我已经尝试了针对 information_schema 的各种查询,但无法获得返回我需要的数据的查询。
该查询将简单地获取表的行数、它的大小(以 MB 为单位)、它的主键列和它的 auto_increment 键列。
我很感激任何帮助。
谢谢
I have another tough MySQL query that I am trying to work out. I need a query that will return the following in a single command:
+----------+------------------------------+-----------+-------------+----------------+--------------------+
| Database | Table_Name | Count | Size | Primary-Key | Auto_Increment_Key |
+----------+------------------------------+-----------+-------------+----------------+--------------------+
| mydb | account_length | 2408 | 0.04 Mb | account_id | account_id |
| mydb | account_log | 1225 | 0.09 Mb | log_id | NULL |
I am still new to MySQL. I have tried various queries against the information_schema, but have not been able to get one that returns the data I need.
The query would simply get a table's row count, it's size in MB, it's primary-key column and it's auto_increment key column.
I appreciate any help.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
像这样的事情会帮助你:
Something like this will help you: