MySql: Show columns but exclude everything except the field names

前端 未结 6 645
陌清茗
陌清茗 2021-01-30 13:36

I\'d like to pull a table\'s field names from MySql into python, and I know that

\'show columns from project\'

will work. And I\'ve read that

6条回答
  •  有刺的猬
    2021-01-30 14:00

    SELECT column_name
    FROM information_schema.columns
    WHERE  table_name = 'your_table'
       AND table_schema = 'database_name'
    

提交回复
热议问题