Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8023163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:29:30+00:00 2026-06-04T22:29:30+00:00

I have two tables with different schemas: Base A, table T1: `id` int(10) unsigned

  • 0

I have two tables with different schemas:

Base A, table T1:

`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL DEFAULT '',
`uid` int(11) NOT NULL DEFAULT '0',
`language` varchar(12) NOT NULL DEFAULT ''

Base B, table T2:

`ID` int(11) NOT NULL AUTO_INCREMENT,
`Type` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
`UserID` int(11) NOT NULL,
`Name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,

I need to transfer data from T1 to T2 in this way:

A.T1.id    -> B.T2.ID
A.T1.title -> B.T2.Name
A.T1.uid   -> B.T2.UserID

As you can see fields A.T1.language and B.T2.Type are not needed.

I think I should do this migration through dump of CSV. But this is all I have come up to.

Any idea?

UPDATE

Thank you guys for your answers. Please forgive me for not being clear enough, I should have emphasized that my tables are in different bases, and even on different servers. So it is not as easy as to just insert fields from one table into another.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T22:29:31+00:00Added an answer on June 4, 2026 at 10:29 pm

    You can do it with a combination of UPDATE and SELECT query. However since TABLE 1 has the column title which is of type VARCHAR(255) and TABLE 2 has the column Name which is of type VARCHAR(100) might give a problem.

    The following query can do this migration however any row with column title having length more than 100 will be SHORTENED to 100.

    INSERT INTO T2 
    (ID, Name, UserID) 
    SELECT id, SUBSTR(title, 0, 100), uid 
    FROM T1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a need to sync auto_increment fields between two tables in different databases
I have two tables, both named Language in two different schemas, lets call them
I have two different schemas in Oracle (say S1, S2) and two tables in
I have two tables, both named as say, Employee in two different schema HR
I have two different tables, lead and click. I would like to query MySQL
I have two different tables from which I need to pull data blogs which
I have two tables with list of urls fetched from different sources. I want
I have two tables which are used to store details of different types of
I have two databases at two different places, both databases are same with table
I've got a table recording views of programs. Each program can have two different

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.