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.

Was it helpful?

Solution

Try this:

SELECT COLUMN_NAME 
FROM information_schema.COLUMNS 
WHERE TABLE_SCHEMA = 'dbName' AND TABLE_NAME = 'tableName' AND 
        LOWER(DATA_TYPE) = 'tinyint'
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top