In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
Editor to share with you mysql how to query the number of rows of the table, I hope you will gain something after reading this article, let's discuss it together!
Mysql query table row number method: 1, use the "SELECT" statement to query all the data in the specified table; 2, use the COUNT () function to count the number of rows of the query results, the syntax is "SELECT COUNT (*) FROM table_name;".
The operating environment of this tutorial: windows7 system, mysql8 version, Dell G3 computer.
Number of rows in the mysql query table
1. Get the number of rows in a single table
SELECT COUNT (*) FROM table_name
two。 Get the number of rows for multiple tables (you can use the UNION operator to combine the result set returned by each SELECT statement)
SELECT 'tablename1' tablename, COUNT (*) rowsFROM table_name1UNION SELECT' tablename2' tablename, COUNT (*) rowsFROM table_name2
3. Get the number of rows of all tables in a database (the information_schema method is sometimes inaccurate)
Use information_schema;select table_name,table_rows from tables where TABLE_SCHEMA = 'db.name' order by table_rows desc; after reading this article, I believe you have a certain understanding of "mysql how to query the number of rows in the table". If you want to know more about it, welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.