Mysql Copier

CahitEy
CahitEy used Ask the Experts™
on
is there any application that copy rows from different table's rows to each other for example
i have a table named xxxx and rows a,b,c,d,e
and i will copy xxxx a,b rows row values to the yyyy table's k,m rows and
xxxx tables c,d,e rows to the zzzz table n,l rows.
also if it is available to get this values from direct sql file without installing to the server it could be great , i will use this tool only for once so if it could be free or time limited that would be super

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
theGhost_k8Database Consultant

Commented:
If you want to insert rows from xxxx to yyyy:

insert into yyyy select * from xxxx where rows in ('a','b');

if you want to update certain fields you may update xxxx table from yyyy table's values as follows::

update xxxx,yyyy set xxxx.col1=yyyy.col1, xxxx.col2=yyyy.col2 where xxxx.id=yyyy.id and yyyy.rows_id in (1,2,3)

Author

Commented:
the row names are different  on this two table
insert into yyyy select * from xxxx where rows in ('a','b');
how could i get values from a,b to k,m
theGhost_k8Database Consultant

Commented:
if you want to replace complete rows...
1. delete k,m rows from yyyy table.
2. insert into yyyy select * from xxxx where rows in ('a','b');

"the row names are different  on this two table" >> Do you mean COLUMN or do you mean Number of colunms?


11/26 Forrester Webinar: Savings for Enterprise

How can your organization benefit from savings just by replacing your legacy backup solutions with Acronis' #CyberProtection? Join Forrester's Joe Branca and Ryan Davis from Acronis live as they explain how you can too.

Author

Commented:
sorry column names :)  forgive me i did not sleep last night :)

Author

Commented:
so in this way it must have the same column names? there is a already designed table yyy and i will get values from xxx table that is the exact problem and column names are different
theGhost_k8Database Consultant

Commented:
Then give column names while inserting. Your question is still unclear.
Is it like you want to update a few fields of table yyyy from table xxxx?
or you just want to insert rows from xxxx to yyyy?

Author

Commented:
no i will insert to the yyyy table from xxxx table
Database Consultant
Commented:
consider yyyy table structure as:

id,col1,col2,col3
id is autoincrement
col3 is nullable

insert into yyyy (id,col1,col2) select null,colX,colY from xxxx where  somecolumn in ('a','b');

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial