码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2019-04-29 15:39:52      阅读:338      评论:0      收藏:0      [点我收藏+]

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

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

(1)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!