Sunday, May 15, 2011

INSERT INTO with SET equal signs, more intuitive than VALUES!

Using equal signs for MySQL INSERT INTO, you can associate a value right next to its column. How intuitive!!

Use this:
INSERT INTO tablename SET col1=value1, col2=value2, col3=value3;

Instead of:
INSERT INTO tablename (col1, col2, col3) VALUES (value1, value2, value3);

No comments:

Post a Comment