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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:45:00+00:00 2026-06-03T10:45:00+00:00

Not sure if this is a basic question or not but I can’t seem

  • 0

Not sure if this is a basic question or not but I can’t seem to figure out the syntax.

I have one table called leads – primary key LeadsId and another table rep_assign with prime key lead_id.

I want to store rep_id, which is a field located in rep_assign, in to the leads table where leads.LeadsId = rep_assign.lead_id.

Anyone know how? I just want to move the data from one table to another where LeadsId is equal to lead_id.

I’ve tried SELECT INTO and INSERT INTO a couple of ways but I can’t seem to get it to work.

Thanks for your help.

  • 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-03T10:45:02+00:00Added an answer on June 3, 2026 at 10:45 am

    It sounds like both of your tables already have most of the data in them. Perhaps you just need to update the leads table to add the rep_id.

    UPDATE leads SET rep_id=(SELECT rep_id FROM rep_assign WHERE rep_assign.lead_id=leads.LeadId ORDER BY rep_assign_id DESC LIMIT 1)
    

    N.B. subqueries like this work in most RDBMSs, but not all. If this doesn’t work for you, it would help if you could tell us what RDBMS you’re using (e.g. MySQL).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have another SQL/access 2007 question that seems really basic but I'm not sure
I'm pretty sure this is a basic question but for some reason i can't
I'm pretty sure this is a basic question but for some reason i can't
Am not sure if this question makes sense. But I know all the basic
Not sure this is a programming question, but we use LaTeX for all our
I'm not sure this is possible, but in ruby, you can dynamically call a
I'm not sure this is possible, but is there a syntax to be used
I'm not sure this question is appropriate here but I hope I could get
Not sure if this is too open-ended of a question for StackOverflow but, I'm
I have what I'm sure is quite a remedial question here, but I can't

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.