I am trying to import a large CSV file into a MySQL database. I uploaded the entire file to one flat table. I can select the data that needs to be moved to separate tables using select statements, my question is how to copy the results of these select queries to different tables. I would rather do it completely in SQL and not worry about using a scripting language.
INSERT INTO anothertable (list, of , column, names, to, give, values, for) SELECT list, of, column, names, of, compatible, column, types FROM bigimportedtable WHERE possibly you want a predicate or maybe not;
INSERT INTO new_table_1 SELECT * FROM existing_table WHERE condition_for_table_1; INSERT INTO new_table_2 SELECT * FROM existing_table WHERE condition_for_table_2;
, . , new_table_1 , "INSERT INTO" "CREATE TABLE".
Source: https://habr.com/ru/post/1706131/More articles:Best (most efficient) DataType to use for UUIDs as JPA identifiers - javaBest practice for invalid delete method parameters - collectionsjQuery UI Datepicker: don't highlight today when it's also selected - javascriptDebugging JBehave scripts - javahttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1706130/visitor-pattern-and-recursion&usg=ALkJrhh0M-Oab6FKpP7Hl0rIHjXu13CPjQAccess blocking for a given geographic location - language-agnosticWhat to learn after PHP, HTML, CSS, MySQL, Javascript? - programming-languages | fooobar.comHow to specify default font and size for a control in Visual Studio? - visual-studio-2008Using ClearQuest for Inventory Management Application - clearquestHow to read files in my WEB-INF directory? - javaAll Articles