Today, I’ve come along with another quick post to explain about how to count the number of columns in MySQL table using MySQL command.
To count a number of columns or fields is very simple and you have to have an idea about your database and table.
Let’s see the MySQL query to count the number of columns in MySQL
1 2 3 4 | SELECT COUNT(*) AS Columns FROM INFORMATION_SCHEMA.COLUMNS |
If you want to count number of columns in a table then execute above query with your database name and table name.
Also Read:
UDF in MySQL
MySQL SHOW Commands
Table Optimization in MySQL
Avoid to use ENUM and SET type in MySQL
That’s it. 🙂
I hope that all makes sense. It can be a very simple to grasp at first, but if you have any trouble at all just drop me a comment and I’ll try my best to help you, don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.
Comments (7)