作者热门文章
- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
mysql支持这样吗?
INSERT INTO `table` VALUES (NULL,"1234") IF TABLE EXISTS `table` ELSE CREATE TABLE `table` (id INT(10), word VARCHAR(500));
最佳答案
我会创建 2 个语句。试试这个:
CREATE TABLE IF NOT EXISTS `table` (
id INT(10),
word VARCHAR(500)
);
INSERT INTO `table` VALUES (NULL,"1234");
关于mysql - INSERT INTO table IF table exists 否则创建表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21409628/
我是一名优秀的程序员,十分优秀!