O'Reilly logo

SQL: Visual QuickStart Guide by Chris Fehily

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Inserting Rows with INSERT

The INSERT statement adds new rows to a table. In this section, I’ll explain how to use several variations of INSERT to:

  • Insert a row by using column positions (INSERT VALUES)

  • Insert a row by using column names (INSERT VALUES)

  • Insert rows from one table into another table (INSERT SELECT)

The important characteristics of INSERT are:

  • In a positional insert, you insert ordered values into a new row in the same sequence as the columns appear in a table (see “To insert a row by using column positions” later in this section). In a named-column insert, you name the specific column into which each value is inserted in the new row (see “To insert a row by using column names” later in this section).

    You always should use a named-column ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required