by Zinal // Nov 12,2012 // 2 comments
Today, I’ve come along with another quick post to explain about how you 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 5 |
SELECT COUNT(*) AS Columns FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = 'database name' AND table_name = 'table name' |
If you want to count number of columns in a table then execute above query with your database name and table name.
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.
After explaining such assured and flexible MySQL Connection which logs error in Email and SMS you want.I am going to explain how you can take READ MORE
MySQL Connection: Let be Assured
Originally I wrote a post about 1 year ago when i discovered some problems happened with me because of the MySQL connection fails. Now I READ MORE
To pass limits with store procedure in MySQL
Today I faced a strange problem that is to apply LIMIT in store procedure in MySQL. I have created one store procedure in MySQL and READ MORE
In MySQL, To modify record we mostly prefer to use UPDATE command and you all have an idea about UPDATE command so let’s see another READ MORE
Do you know you can make custom functions for use in your MySQL queries? If No, Let’s get some basic idea of it.s What is READ MORE
Be a Contributor at CreativeDev.Write an article or tutorial to the community and share some of your knowledge!
thank you very good tutorial;
but i have a problem, is there any thing wrong if i use the CURSOR in a SP after some SELECT and INSERT statements.
i mean in a S/procedure is it necessary that the CURSOR should be used before all other SELECT,EDIT,DELETE statements.
because i am getting a error
Yes CURSOR needs to be declare before Query Statement