Question

I have a task to list the column names with the data type tiny int. I used SHOW COLUMNS but I would like to use the results to make a field in my form based on the show columns result.

Était-ce utile?

La solution

Try this:

SELECT COLUMN_NAME 
FROM information_schema.COLUMNS 
WHERE TABLE_SCHEMA = 'dbName' AND TABLE_NAME = 'tableName' AND 
        LOWER(DATA_TYPE) = 'tinyint'
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top