【问题标题】:How to get list of all the tables in sqlite programmatically如何以编程方式获取sqlite中所有表的列表
【发布时间】:2011-07-17 03:11:46
【问题描述】:

如何以编程方式获取 sqlite 中所有可用表的列表?

【问题讨论】:

标签: sqlite


【解决方案1】:

使用下面的sql语句获取sqllite数据库中所有表的列表

SELECT * FROM dbname.sqlite_master WHERE type='table';

之前在 StackOverFlow 上问过同样的问题。

How to list the tables in an SQLite database file that was opened with ATTACH?

【讨论】:

  • +1 为您的答案,因为您甚至提供了链接以防不清楚。 :-)
【解决方案2】:

试试这个:

SELECT * FROM sqlite_master where type='table';

【讨论】:

    【解决方案3】:

    为我工作

        SELECT * FROM sqlite_master where type='table'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-03-19
      • 1970-01-01
      • 2011-02-05
      • 1970-01-01
      • 1970-01-01
      • 2010-09-25
      • 2019-03-12
      相关资源
      最近更新 更多