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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T19:10:47+00:00 2026-06-18T19:10:47+00:00

Table A(ID, col2, col3, col4) I want to add a new entry to Table

  • 0
Table A(ID, col2, col3, col4)

I want to add a new entry to Table A for every ID given that col4 = ‘certain criteria’ and the value of Col2 from the existing entry will be used as col2 of the new entry. How would I go about accomplishing this task?

The part that is throwing me off is how to do this without using a loop. Any help would be appreciated.

  • 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-18T19:10:48+00:00Added an answer on June 18, 2026 at 7:10 pm

    something like that should work

    INSERT INTO TableA (col2, col3, col4)
    SELECT col2, 'any constant value', col4 FROM TableA
    WHERE col4='certain criteria'
    --GROUP BY ID (not clear if you need to group by something)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a mysql table that looks like this: id col2 col3 col4 1
I have a table that has columns like this for example: id,col1,col2,col3,col4 Now, I
I have a table with four Columns: Col1, Col2, Col3, and Col4. Col1, Col2,
Assume I have the following style table, col1 col2 and col3 have same value
I have a table like this Table1 Col1 Col2 Col3 Col4 Col5 Col6 Col7
I have a table which looks like Col1 col2 col3 col4 col5 1 5
I have a table which looks like Col1 col2 col3 col4 col5 1 5
I have a comma separated value table that I want to read in Python.
How do you merge these two rows? SELECT col1, col2, col3, col4 FROM table_a
I have two tables: A (col1,col2,col3,col4) B (col1,col2,col3,col4) Table A has 4 records(rows) and

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.