Reputation: 3048
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?
If so, how?
Upvotes: 0
Views: 84
Reputation: 62395
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 TIMESTAMP
s) use null
as a value.
Upvotes: 4
Reputation: 121067
If you are insterting into all the columns you can write:
insert into tablename values(...,...,etc.)
Upvotes: 1