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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:41:27+00:00 2026-05-30T20:41:27+00:00

I have got an issue with problem named in topic. I am trying to

  • 0

I have got an issue with problem named in topic.
I am trying to update multiple rows in table in one query depending on specific id of row. Unfortunatelly rows I want to update are text type of data (with numeric data it’s easy). This is my query:

UPDATE table SET column = CASE
WHEN id = 2 THEN column = column + ', 100'
WHEN id = 3 THEN column = column + ', 10'
[...]
ELSE column
END;

Data in column is imploded from php so it looks like:

id | column
------------
 2 | 5, 6, 20
 3 | 7, 12, 200

After executing a query i would like to have:

id | column
------------
 2 | 5, 6, 20, 100
 3 | 7, 12, 200, 10

How to add those values to specified rows? For now it changes ‘column’ row with id 2 and 3 to 0 (like it was an integer type of value).

I also would like to ask you how to erase specific value from column isntead of adding it:

id | column
------------
 2 | 5, 7, 20
 3 | 7, 12, 200

and i want to remove ‘7, ‘ from both rows – with id 2 and 3 so after query it looks like this:

id | column
------------
 2 | 5, 20
 3 | 12, 200

Any help would be appreciated – i got stuck with it :/

  • 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-30T20:41:29+00:00Added an answer on May 30, 2026 at 8:41 pm

    For Insertion:

    UPDATE table 
       SET column = CASE
          WHEN id = 2 
          column =  CONCAT(column, ', 100') 
          WHEN id = 3 
          column =  CONCAT(column, ', 10') 
          ELSE 0
          END
    

    For Removing you can do like dis. Sorry ,I can’t executes the query right now.Not Tested!

    UPDATE table 
       SET column = CASE
          WHEN id = 2 
          column = replace(column,', 7','')
          WHEN id = 3 
          column = replace(column,', 7','')
          ELSE 0
          END
    

    For Updating: If you want to change the value of 7 to 14

        UPDATE table 
       SET column = CASE
          WHEN id = 2 
          column = replace(column,'7','14')
          WHEN id = 3 
          column = replace(column,'7','14')
          ELSE 0
          END
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have got one weird issue. I am working on an asp .net mvc
I've got an performance issue in my application using a MSSQL DB. I have
I have got the following problem since the server has safe mode turned on,
I'm trying to pass structs between processes using named pipes. I got stuck at
I've got an issue involving a website that I have been using VS 2008
I've got a strange problem here. I have a class that I'll call MainView
i have already posted my issue in SO and got an answer but i
Let's say I've got a table that I'm trying to convert. Its got column
I have used Ajax Tab Control in one of my pages. It has got
Have got an NSString *str = @12345.6789 and want to find out if there

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.