SELECT TABLE_SCHEMA,TABLE_NAME,COLUMN_NAME,COLUMN_TYPE , (case when ISNULL(COLUMN_DEFAULT) then 'NULL' when COLUMN_DEFAULT='' then '\'\'' ELSE COLUMN_DEFAULT end)as COLUMN_DEFAULT,COLUMN_COMMENT FROM information_schema.columns WHERE TABLE_SCHEMA = 'table_name'
select TABLE_SCHEMA,TABLE_NAME,COLUMN_NAME,COLUMN_TYPE , (case when ISNULL(COLUMN_DEFAULT) then 'NULL' when COLUMN_DEFAULT='' then '\'\'' ELSE COLUMN_DEFAULT end)as COLUMN_DEFAULT,COLUMN_COMMENT from information_schema.columns WHERE TABLE_SCHEMA = 'table_name'