Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql server insert multiple rows

INSERT INTO table_name (column_list)
VALUES
    (value_list_1),
    (value_list_2),
    ...
    (value_list_n);
Comment

sql insert multiple rows

INSERT INTO MyTable
  ( Column1, Column2, Column3 )
VALUES
  ('John', 123, 'Lloyds Office'), 
  ('Jane', 124, 'Lloyds Office'), 
  ('Billy', 125, 'London Office'),
  ('Miranda', 126, 'Bristol Office');
Comment

how to insert multiple rows in sql

INSERT INTO sales.promotions (
    promotion_name,
    discount,
    start_date,
    expired_date
)
VALUES
    (
        '2019 Summer Promotion',
        0.15,
        '20190601',
        '20190901'
    ),
    (
        '2019 Fall Promotion',
        0.20,
        '20191001',
        '20191101'
    ),
    (
        '2019 Winter Promotion',
        0.25,
        '20191201',
        '20200101'
    );
Code language: SQL (Structured Query Language) (sql)
Comment

sql insert multiple rows from select

INSERT INTO my_table SELECT * FROM source_table;
INSERT INTO my_table (a, b, c) SELECT a, b, c FROM source_table;
INSERT INTO my_table (a, b, c) SELECT a, b, c FROM source_table s
	WHERE s.my_col >= 10;
Comment

sql insert multiple rows from select

  INSERT INTO table2
     (name, email, phone)
     SELECT name, email, phone
     FROM table1;
Comment

sql insert multiple rows

INSERT INTO My_Table (FirstName, LastName)
VALUES
    ('Fred', 'Smith'),
    ('John', 'Smith'),
    ('Michael', 'Smith'),
    ('Robert', 'Smith');
Comment

Insert Multiple Rows at Once in SQL

INSERT INTO Customers(first_name, last_name, age, country)
VALUES
('Harry', 'Potter', 31, 'USA'),
('Chris', 'Hemsworth', 43, 'USA'),
('Tom', 'Holland', 26, 'UK');
Comment

sql insert multiple rows from another table

INSERT INTO customer (first_name, last_name)
SELECT fname, lname
FROM list_of_customers
WHERE active = 1;
Comment

PREVIOUS NEXT
Code Example
Sql :: Msg 241, Level 16, State 1, Line 12 Conversion failed when converting date and/or time from character string. 
Sql :: get first monday of month sql 
Sql :: how to retrive the today date sql 
Sql :: oracle running queries sql 
Sql :: phone no data type in sql server 
Sql :: mysql show schema 
Sql :: RowDataPacket 
Sql :: 1396(hy00) mysql error 
Sql :: how to insert json value in mysql 
Sql :: sql #region 
Sql :: what is default mysql database password in linux 
Sql :: drop column from local database postgres pgadmin 
Sql :: Select without null values sql 
Sql :: print integer and string in SQL 
Sql :: mysql kill 
Sql :: how to check if a column is null in sql 
Sql :: rename table column name in mysql 
Sql :: Postgres - Login and connect as default user 
Sql :: how to access to mysql without root 
Sql :: Get first name and last name from full name string in SQL 
Sql :: oracle free up space in tablespace 
Sql :: How to drop procedures in mysql ? 
Sql :: AND OR NOT operators sql 
Sql :: postgresql filter on 
Sql :: postgres 11 add primary key 
Sql :: sqlite3 turn off case sensitive 
Sql :: counting in sql 
Sql :: sample in sql 
Sql :: Cannot invoke "java.sql.Connection.prepareStatement(String)" because "con" is null 
Sql :: how to upper case in sql 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =