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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:30:59+00:00 2026-06-03T02:30:59+00:00

they are my rows Número Total de Clientes Número Total de Clientes de Número

  • 0

they are my rows

Número Total de Clientes
Número Total de Clientes de
Número Total de Líquidos que se Consumen en el Hogar a la Semana
Número Total de Líquidos que se Consumen en el Hogar a la Semana de
Número Total de garrafones de
Número Total de garrafones en el mercado
Númeto Total de garrafones de
Porcentaje Clientes que Compran por Calidad
Porcentaje Clientes que Compran por Disponibilidad
Porcentaje Clientesque Compran por Otros Motivos
Porcentaje Clientesque Compran por Precio
Porcentaje Total de garrafones de
Porcentaje de Clientes
Porcentaje de Clientes xxxx que Compran en la Ruta Hogar
Porcentaje de Clientes de
Porcentaje de Participación de Ventas de
Porcentaje de garrafones de

my table is named #ope_censo_indicador

you could see i have those

Número Total de Clientes
Número Total de Clientes de

i need it was
Número Total de Clientes marca

but i got
Número Total de Clientes
Número Total marcaClientes marca

with this query

update #ope_censo_indicador set ope_indicadoridname=(replace(ope_indicadoridname,'%de','%marca'))
where ope_indicadoridname like '% de'

with these too

 Número Total de Líquidos que se Consumen en el Hogar a la Semana
 Número Total de Líquidos que se Consumen en el Hogar a la Semana de

i need it return

 Número Total de Líquidos que se Consumen en el Hogar a la Semana
 Número Total de Líquidos que se Consumen en el Hogar a la Semana marca

this too

Porcentaje de Clientes Porcentaje de Clientes Cristal que Compran en
la Ruta Hogar Porcentaje de Clientes de

i need return

 Porcentaje de Clientes Porcentaje de Clientes Cristal que Compran en
 la Ruta Hogar Porcentaje de Clientes marca

( i have more but it would great i got it with one query)

after it, i’ll have.

Número Total de Clientes
Número Total de Clientes marca
Número Total de Líquidos que se Consumen en el Hogar a la Semana
Número Total de Líquidos que se Consumen en el Hogar a la Semana marca
Número Total de garrafones marca
Número Total de garrafones en el mercado
Porcentaje Clientes que Compran por Calidad
Porcentaje Clientes que Compran por Disponibilidad
Porcentaje Clientesque Compran por Otros Motivos
Porcentaje Clientesque Compran por Precio
Porcentaje Total de garrafones marca
Porcentaje de Clientes
Porcentaje de Clientes xxxx que Compran en la Ruta Hogar
Porcentaje de Clientes marca
Porcentaje de Participación de Ventas marca
Porcentaje de garrafones marca

i am going to want to delete those (or to do a query with a distinct but i’ll need return this:)

Número Total de Clientes marca
Número Total de Líquidos que se Consumen en el Hogar a la Semana marca
Número Total de garrafones marca
Número Total de garrafones en el mercado
Porcentaje Clientes que Compran por Calidad
Porcentaje Clientes que Compran por Disponibilidad
Porcentaje Clientesque Compran por Otros Motivos
Porcentaje Clientesque Compran por Precio
Porcentaje Total de garrafones marca
Porcentaje de Clientes xxxx que Compran en la Ruta Hogar
Porcentaje de Clientes marca
Porcentaje de Participación de Ventas marca
Porcentaje de garrafones marca



enter code here
  • 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-03T02:31:00+00:00Added an answer on June 3, 2026 at 2:31 am

    This was tricky! I am assuming you are basically saying you want to replace the LAST “de” with “marca” but only if it is the LAST word. If it is in the middle you want to leave it alone.

    If that is correct, this code handles it:

    -- Setup a temp table with "bigstring" as your text and "lastpos" as the location of LAST "de"
     DECLARE @tmp1 TABLE (bigstring varchar(1000), lastpos int)
     INSERT INTO @tmp1 (bigstring) VALUES ('Número Total de Líquidos que se Consumen en el Hogar a la Semana')
     INSERT INTO @tmp1 (bigstring) VALUES ('Número Total de Líquidos que se Consumen en el Hogar a la Semana de')
     INSERT INTO @tmp1 (bigstring) VALUES ('Leave this de one alone')
    
      -- Ensure we don't have any trailing spaces
      UPDATE @tmp1 SET bigstring = RTRIM(bigstring)
    
      -- If the string ENDS in ' de' then record the starting position of that word
      UPDATE @tmp1 SET lastpos = LEN(bigstring)-2 WHERE RIGHT(bigstring,3) = ' de'
    
      -- Here is how our table looks now
      SELECT * from @tmp1
    
      -- Now, if LASTPOS is not null, we want everything to the LEFT of that + 'marca'
      UPDATE @tmp1 SET bigstring = SUBSTRING(bigstring, 1, lastpos) + 'marca' WHERE lastpos IS NOT NULL
    
      -- Done!
      SELECT * from @tmp1
    

    Your first string was left alone, the second has the final “de” replaced with “marca” and the one I put in there (with “de” in the middle) was left alone.

    I hope that helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to process SqlCommand result (rows) as they come? In other words, I am
I've got a screen that allows users to add & remove rows which they'll
I have 3 buttons in 3 rows: green, yellow and red. They all are
I have three tables with 5 columns each. They can grow upto 15 rows
I've got a grid that show tens of thousands of rows in total, obviously
They seems to erase the line and enter the insertion mode.
They seem to be so nasty. I have a gridview, and the query it
They will also search part of their name. Not only words with spaces. If
They were all working fine on my XAMMP sandbox but now nothing. Something im
They're both resizable arrays, and std::basic_string doesn't have any specifically character-related functions like upper().

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.