According to MySQL table lookup table name field, type, comments and other information sql statement

SELECT
   t.COLUMN_NAME as name,
   (CASE WHEN t.IS_NULLABLE = 'YES' THEN '1' ELSE '0' END) ,
   (t.ORDINAL_POSITION * 10) ,
   t.COLUMN_COMMENT,
   t.COLUMN_TYPE 
 FROM information_schema.`COLUMNS` t
 WHERE t.TABLE_SCHEMA = (select database()) AND t.TABLE_NAME = upper('sys_user')

 

Published 39 original articles · won praise 6 · views 30000 +

Guess you like

Origin blog.csdn.net/qq_40155654/article/details/103010116