SQL query to find Primary Key of a table?

前端 未结 8 451
耶瑟儿~
耶瑟儿~ 2021-02-04 01:30

How can I find which column is the primary key of a table by using a query?

8条回答
  •  野的像风
    2021-02-04 01:56

    In mySQL

    SHOW COLUMNS FROM `table_name`;
    

    This show the details of the columns ie field, data-type, key etc.

提交回复
热议问题