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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:37:07+00:00 2026-06-02T08:37:07+00:00

I have a Table named as Table1 as below ID, JobNo, Date, Comments I

  • 0

I have a Table named as Table1 as below

ID, JobNo, Date, Comments

I have a View named as View1 created with the help of Synonyms from another Read Only Table as below,

ID, JobNo, StartSeq, EndSeq

The column ID is a Primary Key. And I will have to UPDATE Table1 with the Data for columns ID and JobNo from View1.

Lets say View1 has 2 rows and I will INSERT those 2 rows into Table1. So when View1 gets its 3rd row, how do I update the Table1 with the info on 3rd row, without deleting the Data thats previously stored in Table1.

Right now, I have the following query but it doesn’t seem to work because of the Duplicate Primary Key issue.

INSERT INTO Table1(ID, JobNo)
SELECT View1.ID, View1.JobNo
FROM View1

I’m a newbie to SQL so please help me out with this

  • 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-02T08:37:09+00:00Added an answer on June 2, 2026 at 8:37 am

    Assuming you only want to INSERT new data on table1 and not actually UPDATE the data that you already have, then you should do:

    INSERT INTO Table1(ID, JobNo) 
    SELECT View1.ID, View1.JobNo 
    FROM View1
    WHERE View1.ID NOT IN (SELECT ID FROM Table1)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table named table1 where datas are entered as below. slno scxid
I have a table as below Name Priority Date ------------------------- A 2 d1 B
I have a table as below dbo.UserLogs ------------------------------------- Id | UserId |Date | Name|
I have a table named product_table as below with two fields product_id and comp_prod
I have a table named category with values as below, CategoryId      |
I have this table named categories with three fields as below cat | order
i have table called table1 and it looks like the below record type tran_ref_number
I have several tables which looks like these below: <table id=table1> <tr> <th>Item</th> <th>Price</th>
I have a mysql database with a table structure like below : Table Name
i have a table t_points in mySql like example in below. Name Surname Point

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.