sqlite3如何判断一个表是否已经存在于数据库中 C++

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 the table doesn't exist, table_name if it does.

sqlite3如何判断一个表是否已经存在于数据库中c++

posted @ 2019-04-29 15:14  shfanzie  阅读(3270)  评论(0编辑  收藏  举报