How can I get the list of a columns in a table for a SQLite database?

后端 未结 8 1204
梦谈多话
梦谈多话 2020-11-28 23:04

I am looking to retrieve a list of columns in a table. The database is the latest release of SQLite (3.6, I believe). I am looking for code that does this with a SQL query

8条回答
  •  孤城傲影
    2020-11-28 23:39

    The question is old but the following hasn't been mentioned yet.

    Another convenient way in many cases is to turn headers on by:

    sqlite> .headers on
    

    Then,

    sqlite> SELECT ... FROM table
    

    will display a headline showing all selected fields (all if you SELECT *) at the top of the output.

提交回复
热议问题