Answers for "insert mysql"

SQL
15

mysql insert

INSERT INTO table_name (a, b) VALUES (val1, val2); 
INSERT INTO table_name (a, b) VALUES (val1, val2), (val3, val4); -- 2 rows

-- From a query:
INSERT INTO table_name (a, b) 
	SELECT val1 AS a, val2 AS b 
    FROM source_table s
	WHERE s.val1 >= 10;
Posted by: Guest on July-04-2021
5

mysql insert

INSERT INTO table1 (col1, col2) VALUES (3, 'A string');
INSERT INTO table1 (col1) VALUES (3);			-- col2 will be NULL if allowed
INSERT INTO table1 VALUES (3, 'A string');     	-- all table1 columns
INSERT INTO table1 (col1, col2) SELECT value3, value1 FROM table2;
Posted by: Guest on May-04-2021
5

insert mysql

INSERT INTO tbl_name (a,b,c) 
    VALUES(1,2,3), (4,5,6), (7,8,9);
Posted by: Guest on May-05-2020
-1

insert into mysql

INSERT INTO "table_name" ("column1", "column2", "column3", ...)
VALUES ('value1', "value2", 'value3', ...);
Posted by: Guest on May-02-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language