sql - MySQL count columns in table by name -


is possible count number of columns in table name?

eg

select count(*) information_schema.columns column '%name%' , table_schema = 'db_name' , table_name = 'table_name' 

i have table adds columns table custom fields added user , need count added columns use result in while loop

yes, possible. there's chance need use column_name in where in place of column -- @ least, that's how listed in mysql docs:

select count(*)  information_schema.columns  column_name '%name%'    , table_schema = 'db_name'    , table_name = 'table_name' 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -