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.
原文地址:https://www.cnblogs.com/shfanzie/p/10790519.html
时间: 2024-10-07 11:52:37