开发者

MySQL insertion with all values at once

I was doing an INSERT INTO TABLE(...,...,...,...,...) VALUES(...,...,..., When I closed by mistake my MySQL Query Browser. The table has too many columns, so I was wondering, is there a command that you don't need to type all names of the columns table?

开发者_JS百科If so, how?


THere is

INSERT INTO TABLE VALUES(...,...,...)

You just need to specify ALL fields in EXACTLY same sequence as they're in table definition.

For AUTO_INCREMENT column, or for columns where you want to use DEFAULT value as defined in table definition (also TIMESTAMPs) use null as a value.


If you are insterting into all the columns you can write:

 insert into tablename values(...,...,etc.)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜