1.列出当前db文件中所有的表的表名 SQL语句:SELECT * FROM sqlite_master WHERE type='table'; 结构如下: 注:网上有人说可以带上db文件的名称,如:SELECT * FROM dbname.sqlite_master WHERE type='table'; 但我试了不行...难道我姿势不对~ 2.判断某表是否存在SQL语句:select count(*) from sqlite_master where type='table' and nam…
sqlite查看所有表名.判断表是否存在,字段名及字段信息 sqlite查看所有表名及字段名查询table,type 段是'table',name段是table的名字, select name from sqlite_master where type='table' order by name; 如果type段是'index', 则name 是index的名字,tbl_name是index所拥有的table的名字. 如果type段是'table',则name是表名由此可以进一步引深:判断指…
SELECT count(*) AS cnt FROM sqlite_master WHERE type='table' AND name='table_name';cnt will return 0, if the table doesn't exist, 1 if it does. 或者, SELECT name FROM sqlite_master WHERE type='table' AND name='{table_name}';This will return empty, if t…