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

  • SEARCH
  • Home
  • 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 6011023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:12:00+00:00 2026-05-23T02:12:00+00:00

I have database1 with table table1 and 3 columns: column1a, column1b, column1c I have

  • 0

I have database1 with table table1 and 3 columns: column1a, column1b, column1c
I have database2 with table table2 and 1 columns: column2a

I would like to copy the values from the database2 (from column2a) to database1 column1a and the others values of column1b and column1c set to a certain constant value e.g.

INSERT INTO database1.table1 (column1a,'column1b' = 'apple','column1c'= 'orange') SELECT `column2a` FROM database2.table2;

However, in the fisrt part if the statemnt are 3 values and in the second is only 1, so I suppose there is a problem and this statement is bad :(.

Any advice how to rewrite my mysql statement?

  • 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-05-23T02:12:00+00:00Added an answer on May 23, 2026 at 2:12 am

    Here’s the solution:

    INSERT INTO database1.table1 (column1a, column1b, column1c)
    SELECT column2a, 'apple', 'orange' FROM database2.table2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two Tables in two different databases Database1 - Table1 Database2 - Table2
lets say I have a table called table1 and it's corresponding columns are col1,
I have two tables with columns of my interests as Table1.Column1 and Table2.Column2 Table1
I have my tags desinged like this in my database: Table: Item Columns: ItemID,
I have a database table like that :- Table1 Column1 : Varchar(50) Column2 :
Suppose I have a database table with columns a, b, and c. I plan
I have a database table named call with columns call_time, location, emergency_type and there
I have one database table which contains 8 columns. One of the columns is
I have two tables in my database: NEWS table with columns: id - the
I have a java class containing all the columns of a database table as

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.