Counting Columns in a Table using MySQL
This article addresses the query of counting the number of columns within a MySQL table. Let's delve into how this can be achieved.
To determine the column count of a table named "tbl_ifo," follow this SQL statement:
SELECT count(*) FROM information_schema.columns WHERE table_name = 'tbl_ifo'
Let's break down this query:
By executing this query, you will obtain a single row with a single column displaying the column count of the specified table.
The above is the detailed content of How to Count Columns in a MySQL Table?. For more information, please follow other related articles on the PHP Chinese website!