Python创建MySQL表时,如何检测该表是否已存在?
- 内容介绍
- 文章标签
- 相关推荐
本文共计40个文字,预计阅读时间需要1分钟。
sql创建表,如果不存在:sqlCREATE TABLE IF NOT EXISTS tableName (xxx);
create table if not exists tableName(xxx);
'''
cursor.execute(sql)
db.commit()
本文共计40个文字,预计阅读时间需要1分钟。
sql创建表,如果不存在:sqlCREATE TABLE IF NOT EXISTS tableName (xxx);
create table if not exists tableName(xxx);
'''
cursor.execute(sql)
db.commit()

