SQL Inserting Data

From Kb

Jump to: navigation, search

> SQL_Query_Examples > Current

There are two basic forms for this command that you can choose from:

 mysql> INSERT INTO <table name> SET
    ->  columnName1 = value1,
    ->  columnName2 = value2,
    ->  ...
    -> ;


  mysql> INSERT INTO <table name>
    -> (columnName1, columnName2, ...)
    -> VALUES (value1, value2, ...);


inserting multiple rows with one insert
  INSERT INTO <table name> VALUES(val1, val2),(val1,val2);