Mysql insertar varias filas en una columna

Ejemplos de código

22
0

N

INSERT IGNORE INTO table_name (column_list)
VALUES
    (value_list_1),
    (value_list_2),
    ...
    (value_list_n);
9
0

N

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

N

SELECT *
FROM INFORMATION_SCHEMA.COLUMNS 
WHERE TABLE_NAME = N'Customers' 
-- INFORMATION_SCHEMA is an ANSI-standard (American National Standard Institute) set of read-only views which provide information about all of the tables, views, columns, and procedures in a database
-- "N" defines the subsequent string (the string after the N) as being in unicode
0
0

N

INSERT IGNORE INTO table1 (col1, col2, col3, col4, col5) 
SELECT col1,col2,col3,col4,col5 
FROM table2 t2 
WHERE t2.val2 IN (MULTIPLE VALUES) 
AND (Another Conditional);

Páginas relacionadas

Páginas de ejemplo relacionadas

En otros idiomas

Esta página está en otros idiomas

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................