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

或者,sql

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

相關文章
相關標籤/搜索