开发者

MySQL insertion with all values at once

开发者 https://www.devze.com 2023-02-07 14:20 出处:网络
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 y

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

精彩评论

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