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

The Archive Base Latest Questions

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

MySQL noob here; looked around first but couldn’t find the answer to this question.

  • 0

MySQL noob here; looked around first but couldn’t find the answer to this question.

So I have two tables in MySQL, one (Table1) which consists of one column containing unique list of names (Col1) and another containing corresponding binary values (Col2). The second table (Table2) contains a list of recurring names with a empty column waiting to be filled with binary values from the first table. What I want to do is, for each instance of a recurring name in Table2, insert the binary value from Col2 associated with the matching unique name in Table1.

I know how to do this in Excel—you just place the following VLOOKUP statement next to every row containing a recurring name. In the following code snippet A2 is a recurring name, unique names are contained in column B, and the binary values are contained in column C.

=VLOOKUP(A2,$B$2:$C$106095,2,FALSE)

But I can’t for the life of me figure out how to reproduce this effect in MySQL. I can’t use Excel because there’s too much data. Anyone have any ideas? Thanks in advance!

  • 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-21T18:27:32+00:00Added an answer on May 21, 2026 at 6:27 pm

    I think that you want something like this (I don’t know what the Excel statement does):

    UPDATE table2 JOIN table1 ON table1.col1 = table2.col1
    SET table2.col2 = table2.col2
    WHERE table2.col2 IS NULL
    

    This will update each row table2 that has col2 empty, searching for the corresponding row in table1 based on matching col1 columns.

    Btw, do you have a reason to do this? Why not just join both tables when selecting the data? For example:

    SELECT table2.col1, table1.col2
    FROM table2 JOIN table1 ON table1.col1 = table2.col1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This might be a noob question but I can't find anything wrong with my
Sorry because this is a noob question. I'm new with MySQL: I wrote a
I guess this is a bit of a noob question but I haven't seen
I am a mySQL noob, and have a slightly stupid question... I am using
Hi searched through the questions here, but couldn't find anything. I'm new at writing
This is a bit noob question but.. Its happens sometimes to everybody. I never
this questions looks really easy but I'm a noob in C++ and MySQL so
I'm trying to debug some auto-generated code, but I am a mySQL noob. Everything
I am guessing this is a noob question so please bear with me. I
I'll start off by saying I'm a noob with all of this, I have

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.