ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

How To Move 1 million Records from One table to Another Table?

user-image
تم إضافة السؤال من قبل Jettiboyina Rajesh , Java Developer , XML FRAMEWORKS COM PVT LTD
تاريخ النشر: 2017/04/24
Ibraheem Umar
من قبل Ibraheem Umar , Technical Consultant , DXC technology Pvt Ltd

One way is :

using  SELECT INTO OUTFILE to put data in test.csv file :

SELECT * INTO OUTFILE 'test.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\\n' FROM <table name>

Then Insert to new table :

LOAD DATA INFILE 'test.csv' INTO TABLE <tablename> FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\\n' (column1,column2,column3)

 

Ghazanfar Shafiq
من قبل Ghazanfar Shafiq , Project Supervisor , A Tayebat Hyper Market

1. Use Import or export method

 

OR

2. Create table with same structure(design). Let say new table name is "table2" and first one from where you want to transfer is "table1".  then use this query

 

insert into table2 select *from table1

 

Use this query

amar husain
من قبل amar husain , Lead full stack developer , Saudi Aramco

alter table mytable add (newcolumn date); update mytable set newcolumn = oldcolumn; alter table mytable drop (oldcolumn);It's usually faster to disable the keys first, do the inserts, then enable the keys after insertion.

Uday Amineni
من قبل Uday Amineni , Process Associate , [24]7

By using a VIEW we can move the data from ne table to another table that is data migration

Azam Mirzobekov
من قبل Azam Mirzobekov , Waiter , Louvre Museum Restaurant

INSERT INTO `db`.`table_to`

SELECT *

FROM `db`.`table_from` ;

subhojit chaudhury
من قبل subhojit chaudhury , TIER 2 ENGINEER , ACONEX INDIA PVT. LTD.

Create table with same structure(design). Let say new table name is "table2" and first one from where you want to transfer is "table1".  then use this query

 

 

 

insert into table2 select *from table1

المزيد من الأسئلة المماثلة

هل تحتاج لمساعدة في كتابة سيرة ذاتية تحتوي على الكلمات الدلالية التي يبحث عنها أصحاب العمل؟