Search
 
SCRIPT & CODE EXAMPLE
 

SQL

insert all in sql

INSERT ALL  
  INTO table_name (column1, column2, column_n) VALUES (expr1, expr2, expr_n)  
  INTO table_name(column1, column2, column_n) VALUES (expr1, expr2, expr_n)  
  INTO table_name (column1, column2, column_n) VALUES (expr1, expr2, expr_n)  
SELECT * FROM dual;  
Comment

sql insert all

-----------------------------------------------------------------
-- OPTION 1: Insert specific values (other values will be null)

-- syntax 
INSERT INTO <TABLE_NAME> (<column1>,<column2>,<column3>,...) 
VALUES (<value1>,<value2>,<value3>,...);

-- example
INSERT INTO SALES (SALE_ID,ITEM_ID,QUANTITY,AMOUNT)
VALUES (631,13,4,59.99);
-----------------------------------------------------------------
-- OPTION 2: Insert a value for every field

-- syntax
INSERT INTO <TABLE_NAME> (<value1>,<value2>,...,<valueN>);

-- example (SALES table only consists of 4 columns)
INSERT INTO SALES (631,13,4,59.99);
-----------------------------------------------------------------
Comment

PREVIOUS NEXT
Code Example
Sql :: get row affected mysql 
Sql :: oracle undo usage by session 
Sql :: change default role snowflake 
Sql :: how to drop a database in sql server when it is in use 
Sql :: MYSQL HOT TO COUNT THE DURATION BETWEEN TWO DATES 
Sql :: psql connect 
Sql :: how to check xampp mysql password 
Sql :: t sql to rebuild all indexes in a database 
Sql :: postgresql get last 10 records 
Sql :: datepart postgres 
Sql :: sql where keyword contains 
Sql :: sql values not in another table 
Sql :: check mysql username and password ubuntu 
Sql :: docker run postgres locally 
Sql :: sql server substring 
Sql :: restore postgres database from dump 
Sql :: how to add where command in update comand with joins 
Sql :: get comma separated values in sql server 
Sql :: sql first character 
Sql :: psql select unique 
Sql :: how to rename a database in tsql 
Sql :: sql count distinct group by 
Sql :: sql select second max 
Sql :: sql drop default 
Sql :: concat column data in sql laravel 
Sql :: select sequence oracle 
Sql :: postgresql add column 
Sql :: n highest salary in sql 
Sql :: create index mysql cli 
Sql :: create view in sql 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =