mysql通過欄位注釋尋找欄位名稱,mysql欄位注釋名稱

來源:互聯網
上載者:User

mysql通過欄位注釋尋找欄位名稱,mysql欄位注釋名稱

   有時候表的欄位太多,只是大致記得表的注釋,想通過欄位注釋尋找欄位名稱,可以用如下語句:

SELECT COLUMN_NAME,column_comment FROM INFORMATION_SCHEMA.Columns WHERE table_name='tj_record' AND table_schema='tianjin_20140811' AND column_comment LIKE  '%資料是否有效%'

其中table_schema為資料庫名。查詢的如下:

你也可以通過欄位名稱尋找注釋,通過以上語句。


=============查看錶的欄位個數:desc tj_record   文法是: desc 表名

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.