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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:07:27+00:00 2026-05-21T09:07:27+00:00

I need to insert data to new table which the fields are constructed from

  • 0

I need to insert data to new table which the fields are constructed from two existing tables named Table1 and Table2 as below. The path1 and path2 are from Table2 but the references are stored in Table1. Table1 should not be altered, because Table2’s path field will be changed.

New Table
id path1 path2
1  /a/b  /a/c
2  /a/d  /a/e


Table1
id path1_id path2_id
1  1        2
2  3        4


Table2
id path
1  /a/b
2  /a/c
3  /a/d
4  /a/e
  • 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-21T09:07:27+00:00Added an answer on May 21, 2026 at 9:07 am

    You didn’t give us much to work with, so here is an attempt just to get the boll rolling:

    insert 
      into new_table(id, path1, path2)
    select t1.id
          ,p1.path
          ,p2.path
      from table1 t1
      join table2 p1 on(p1.id = t1.path1_id)
      join table2 p2 on(p2.id = t1.path2_id)
    

    …based on the following assumptions about your data:

    • table1.id is a unique key
    • table2.id is a unique key
    • new_table.id “inherits” the key from table1
    • There is a (trusted or enforced) foreign key constraint from table1.path1_id => table2.id
    • There is a (trusted or enforced) foreign key constraint from table1.path2_id => table2.id
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to insert data from table1 into table2. However, I would like to
I have two table. OLDTABLE and NEWTABLE. I need to insert some data from
I need to select data from one table and insert it into another table.
Hi need insert data in table if the record is not already exits Ex:
now i need to insert some data from the sqlserver into a word,i know
I need to create an SQL query to insert some data into a table
How do I restore my data from a backup table table1_bu into a new
I need to insert/update data by using link or image I need a code
I am having issues with ADO.NET 2.0 merging/importing data. I need to update/insert data
I need to know how I can insert data inside objects inside an array

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.