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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:28:19+00:00 2026-05-23T03:28:19+00:00

Basically I’m trying to combine two tables together into a new table. The first

  • 0

Basically I’m trying to combine two tables together into a new table. The first table contains information on users and the second table stores information on purchases along with address specific information.

The end result would be a new updated table for Users that now includes addresses for each user (eg. zipcode, state, country) that will be merged from the Deals_Users_Assoc table.

Here’s the query that I have so far:

INSERT INTO NewUsers (User_ID, FirstName, LastName, City, StateProvince, Country, ZipCode, Username, Username_Clean, Password, Email, ActivationToken, LastActivationRequest, LostPasswordRequest, Active, Group_ID, SignUpDate, LastSignIn)

SELECT DISTINCT a.User_ID, a.FirstName, a.LastName, b.address_city, b.address_state, b.address_country, b.address_zip, a.Username, a.Username_Clean, a.Password, a.Email, a.ActivationToken, a.LastActivationRequest, a.LostPasswordRequest, a.Active, a.Group_ID, a.SignUpDate, a.LastSignIn

FROM Users a, Deals_Users_Assoc b

WHERE a.User_ID = b.user_id

GROUP BY a.User_ID;

It’s working, but only inserting data for users that are also stored in the Deals_Users_Assoc table (WHERE a.User_ID = b.user_id). Hundreds of user id’s are still remaining in the Users table.

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-05-23T03:28:20+00:00Added an answer on May 23, 2026 at 3:28 am

    Try to use SELECT query with LEFT JOIN clause –

    SELECT a.User_ID, a.FirstName, a.LastName, b.address_city, b.address_state, b.address_country, b.address_zip, a.Username, a.Username_Clean, a.Password, a.Email, a.ActivationToken, a.LastActivationRequest, a.LostPasswordRequest, a.Active, a.Group_ID, a.SignUpDate, a.LastSignIn
    FROM Users a
    LEFT JOIN Deals_Users_Assoc b
      ON a.User_ID = b.user_id
    GROUP BY a.User_ID;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, how do I make it so I can do something similar to: CurrentCollection.Contains(...)
Basically, I want this: The highest voted answer 3 vote The others answer 1
Basically I want to create a custom handler to unserialize a db field called
Basically what i want is this but in a for-loop.. echo `date +'['%H':'%M':'%S']'` -
Basically, I have a point in my workflow where after a document has been
Basically I am not using a MasterPage and I just have a project with
Basically i want to pub/sub Protocol buffer messages over a tcp async socket. Are
Basically I have string of whitespace or blocks of whitespace or empty in some
Basically what I have to do is this: I have a file containing names

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.