Things (about MySQL) my father never told me...

Just discovered one of those things I should have discovered a long, long time ago: in MySQL (and, I assume, every-other-SQL), this:

insert into table (field1,field2,field3) values (1,2,3)
insert into table (field1,field2,field3) values (4,5,6)
insert into table (field1,field2,field3) values (7,8,9)

…can also be expressed like this:

insert into table (field1,field2,field3) values 
                  (1,2,3),
                  (4,5,6),
                  (7,8,9)

The difference is that the second form, especially if you’ve got lots of inserts to do, is much, much faster.

Comments

swen's picture
Windows Vista build 5270 Download: http://windows.czweb.org/491_HTTP_DOWNLOAD_of_Windows_Vista_build_5270 Windows VISTA Activation: http://windows.czweb.org/502_Windows_VISTA_Activation! Download Windows Vista Official 113 Icons: http://windows.czweb.org/504_Download_Windows_Vista_Official_113_Icons

Post new comment

You can comment anonymously if you must, but I would prefer it if you used your real name.
The content of this field is kept private and will not be shown publicly. If you have a Gravatar account associated with the e-mail address you provide, it will be used to display your avatar.
Optional. If you enter the address of a website here, your name will be publicly linked to the site.
  • Adds typographic refinements.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.