如何插入空行,但自动编号正确更新? [英] How do I insert an empty row, but have the autonumber update correctly?

查看:93
本文介绍了如何插入空行,但自动编号正确更新?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够做类似的事情

I was hoping to be able to do something like

INSERT INTO `table`;

或者甚至是像SET子句

or maybe even a SET clause like

SET `primary_key` = null

除应设置自动编号的主键外,未设置表的所有列(并将其保留为默认值).

where all the columns of the table aren't set (and are left to their default), with the exception of the autonumbered primary key which should be set.

有什么建议吗?

推荐答案

INSERT INTO `table` (`primary_key`) VALUES (NULL);

这篇关于如何插入空行,但自动编号正确更新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆