当前位置:首页 > 数据库 > SQlite

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++

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

标签:sele   turn   type   存在   https   sqlite3   this   select   article   

本文系统来源:https://www.cnblogs.com/shfanzie/p/10790519.html


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!