当前位置:网站首页>Attributes, comments and field information of fields in MySQL query table

Attributes, comments and field information of fields in MySQL query table

2022-06-22 03:28:00 Fenghua Langlang

  • mysql Query the attributes and comments of all fields in the table

    select * from information_schema.columns where table_name=' Table name '
    
  • mysql Get all field information of the table

    SELECT
    	column_name columnName,
    	data_type dataType,
    	column_comment columnComment,
    	column_key columnKey,
    	extra 
    FROM
    	information_schema.COLUMNS 
    WHERE
    	table_name = 'user' 
    	AND table_schema = ( SELECT DATABASE ( ) ) 
    ORDER BY
    	ordinal_position
    
原网站

版权声明
本文为[Fenghua Langlang]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206220312376241.html