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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:25:20+00:00 2026-06-18T09:25:20+00:00

I have 2 tables: table1: NULL NULL Cat.XX 23 Cow.XX 87 NULL NULL Tiger.XX

  • 0

I have 2 tables:

table1:

NULL    NULL    Cat.XX 23   Cow.XX 87
NULL    NULL    Tiger.XX 99 Elephant.XX

Column1 and Column2 are ID numbers that are associated with the value in column3 and column4 respectively.

table2:

84048713    Cat.XX 23   Blah1   Blah2   Blah3   Blah4   
44008714    Elephant.XX 77  Blah1   Blah2   Blah3   Blah4   
64038715    Cow.XX 87   Blah1   Blah2   Blah3   Blah4
34058716    Tiger.XX 99 Blah1   Blah2   Blah3   Blah4
74038717    Zebra.XX 34 Blah1   Blah2   Blah3   Blah4
94098719    Whale.XX 47 Blah1   Blah2   Blah3   Blah4

I want to update each row in table1 with the appropriate ID numbers. The resulting table1 should look like the following:

84048713    64038715    Cat.XX 23   Cow.XX 87
34058716    44008714    Tiger.XX 99 Elephant.XX

I have tried various combinations of using select, where and select replace (I use replace because the fields that contain the animal names have spaces in them). For example I tried the following:

select IDs from table2 where 
(select replace("Name", ' ', '') from table2
LIKE
(select replace("Name", ' ', '') from table1)

But I get the following error:

Msg 512, Level 16, State 1, Line 1
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

I appreciate your help. Thank you.

  • 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-18T09:25:22+00:00Added an answer on June 18, 2026 at 9:25 am
    update table1 set Column1ID = (select ID from table2 where column2 = table1.column3),Column2ID = (select ID from table2 where column2 = table1.column4)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

You have a table table1 that contains id column, that is int(11), not null,
I have 2 tables: CREATE TABLE `product_det` ( `id` bigint(12) unsigned NOT NULL AUTO_INCREMENT,
I have several tables: CREATE TABLE [dbo].[Tracks]( [Id] [uniqueidentifier] NOT NULL, [Artist_Id] [uniqueidentifier] NOT
We have a table called table1 ... (c1 int indentity,c2 datetime not null,c3 varchar(50)
I have the following tables CREATE TABLE `files` ( `fileid` int(11) NOT NULL AUTO_INCREMENT,
I have two tables like, CREATE TABLE [dbo].[entry] ( [id] [int] NULL, [service] [int]
So I have two tables structured like so: CREATE TABLE #nodes(node int NOT NULL);
I have the following tables: pages : +------------+--------------+------+-----+---------+----------------+ | Field | Type | Null
I have 2 tables in my MySQL table: cat and notes. MySQL for cat
I have two MySql tables like the following: Cat ------ id : INT NOT

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.