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 5939991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:54:21+00:00 2026-05-22T15:54:21+00:00

If I type: INSERT INTO table_b SELECT rowid, somecolumn FROM table_a …the rowid column

  • 0

If I type:

INSERT INTO table_b 
SELECT rowid, somecolumn 
  FROM table_a 

…the rowid column would copy into new table as ordinary column and this would most likely produce an error since columns wouldn’t match.

But is there a way to copy exactly the same rowids from old table to new when I’m populating it fresh ?

I know it is possible to do it that way:

INSERT INTO table_b 
  (rowid, othercolumn) 
  VALUES (334,  'sometext')

…but that needs to be write row by row instead of one line sql command.

  • 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-22T15:54:22+00:00Added an answer on May 22, 2026 at 3:54 pm

    The first SQL you write is correct and will copy all information matching the columns.
    You can also use a query like this:

    INSERT INTO table2( rowId, rowValue)
    
    SELECT rowId, rowValue FROM table1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Step 1: Loading data via bulk insert from .txt (delimited) file into Table 1
Ive been struggling to get my data to insert into my table. The data
I was trying to insert some data into a table and I got the
When I insert a DVD or CD, I want to programmatically know what type
I type ArrayList memberNames = new ArrayList() { Jim, John, George }; and Visual
What type of authentication would you suggest for the service that is: implemented as
For example I have the following tables resulting from: CREATE TABLE A (Id int,
I have JDBC code which inserts into a database table by executing a PreparedStatement.
I have a stored procedure (see below) which inserts data into a physical table
UPDATE : The issue was col1 was hiereachyid type and even a select didnt

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.