[The MySQL] Calculation table column (Columns count)

Summary: [MySQL] calculates the number of Data Field (columns count)


There are days when writing SQL syntax, you can think of the data items in the statistics table, then if I want to count field in the data table, then, whether it be feasible?
After Google, type keywords "mysql columns count", the query has to stackoverflow topic of discussion, the following SQL query syntax (note ~ notes ~)
(Reference data: http: //stackoverflow.com/questions/10492164/how-do Columns COUNT----i-of-table A)

the SQL syntax: SELECT count (*) information_schema.columns WHERE table_schema = ' database name' && table_name = 'table name' the FROM

Example illustrates:





Original link large column  https://www.dazhuanlan.com/2019/07/21/mysql%e8%ae%a1%e7%ae%97%e6%95%b0%e6%8d%ae%e8%a1% a8% e5% ad% 97% e6% ae% b5% e6% 95% b0% e9% 87% 8fcolumns-count /

Guess you like

Origin www.cnblogs.com/chinatrump/p/11416186.html