Einfügen in die Tabelle aus einer anderen Tabelle mySQL ein
INSERT INTO table1 (emp_id, fname)
SELECT emp_id, fname
FROM table2
WHERE status = 'Active';
Stratocaster
INSERT INTO table1 (emp_id, fname)
SELECT emp_id, fname
FROM table2
WHERE status = 'Active';
--format
INSERT INTO Customers (CustomerName, City, Country)
SELECT SupplierName, City, Country FROM Suppliers;
--examples
INSERT INTO Customers (CustomerName, City, Country)
SELECT SupplierName, City, Country FROM Suppliers;
INSERT INTO table2
SELECT * FROM table1
WHERE condition;
INSERT INTO tableName
VALUES (‘anydata’, ‘anydata’, ‘anydata’, ‘anydata’, NULL,
NULL);
INSERT INTO table1 ( column1, column2 )
SELECT col1, col2
FROM table2
$sql = "INSERT INTO table_name('arg1, 'arg2', ...) VALUES ('value1,
value2, ...)'";