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.

有帮助吗?

解决方案

Try this:

SELECT COLUMN_NAME 
FROM information_schema.COLUMNS 
WHERE TABLE_SCHEMA = 'dbName' AND TABLE_NAME = 'tableName' AND 
        LOWER(DATA_TYPE) = 'tinyint'
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top