-1

If I wanted to insert data into the same column multiple times as follows:

INSERT INTO string_tbl(vchar_fld) VALUE ('abcd');
INSERT INTO string_tbl(vchar_fld) VALUE ('xyz');
INSERT INTO string_tbl(vchar_fld) VALUE ('QRSTUV');
INSERT INTO string_tbl(vchar_fld) VALUE ('qrstuv');
INSERT INTO string_tbl(vchar_fld) VALUE ('12345');

Is there a more efficient way than the above of having to write identical inserts with the exception of the distinct data?

Robert
  • 10,126
  • 19
  • 78
  • 130
  • Perhaps reading http://dev.mysql.com/doc/refman/5.7/en/load-data.html might help – Ed Heal Jan 31 '16 at 14:40
  • Duplicate: http://stackoverflow.com/questions/452859/inserting-multiple-rows-in-a-single-sql-query Couldn't find a button to mark as duplicate... Where can I find that functionality? – Hafenkranich Jan 31 '16 at 14:44

1 Answers1

2

INSERT INTO string_tbl(vchar_fld) VALUES ('abcd'),('xyz'),('QRSTUV');

Hafenkranich
  • 1,696
  • 18
  • 32