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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T16:09:11+00:00 2026-05-19T16:09:11+00:00

Alright I have something like this(I messed it up…) – Id Name City 1

  • 0

Alright I have something like this(I messed it up…) –

Id Name                     City
1  XXX - New                Plano
2  XXX - XXX - New1         Dallas
3  XXX - XXX - XXX - New2   Sacramento
4  XXX - New3               Houston
5  XXX - XXX - New4         Austin

So, I want to replace all the occurrence with more that one XXX prefix to just 1. For e.g id 2 should have Name=XXX - New2. How would go about achieving this ? Even a query basically to check for a prefix and replace it with the name would work I think and then I can add the prefix again ? I mean set all the records just to say New,New2..so on…and then I can add XXX prefix to 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-19T16:09:12+00:00Added an answer on May 19, 2026 at 4:09 pm

    You can remove all instances of ‘XXX – ‘ with the string replace function.

    UPDATE tableName
    SET Name = Replace(Name, 'XXX - ', '')
    

    Alternately, to keep a single instance you could use:

    UPDATE tableName
    SET Name = 'XXX - ' + Replace(Name, 'XXX - ', '')
    WHERE CHARINDEX('XXX - ', Name) > 0
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Alright I have an xml document that looks something like this: <xml> <list> <partner>
Alright so, I have something that looks like this : for (j = 0;
Alright, this is melting my brain. It might have something to do with the
what if I would have something like this: public static void DoSomething() { try
I have a javascript function that goes something like this: function doSomething(me) { var
Alright, so I have a query that looks like this: SELECT `orders`.*, GROUP_CONCAT( CONCAT(
Let's say I have something like this: interface Scope extends ng.Scope { getMeSome(id:string):number[]; }
Alright have been working to switch to jQuery 1.7's new and improved .on() function
Alright so I have no idea how to even begin doing this But basically
Alright simple question I have integriters like 5 188 4634 And they all need

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.