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

  • Home
  • SEARCH
  • 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 6082785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:19:41+00:00 2026-05-23T11:19:41+00:00

I wish to replace some text within a field, so i have the following

  • 0

I wish to replace some text within a field, so i have the following statement:

UPDATE INVENTORY
SET INV_DESCRIPTION = REPLACE(INV_DESCRIPTION, '5 ml', '5ml (1/6oz)')

The problem lies in the fact that this statement will replace strings such as ‘5 ml’ ’15 ml’ ‘150 ml’ etc, with the replacement string. I wish for this function to match the whole word and just look for ‘5 ml’

  • 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-23T11:19:41+00:00Added an answer on May 23, 2026 at 11:19 am

    You could add a WHERE clause which should get you pretty close:

    ...Your Current Query...
    WHERE INV_DESCRIPTION LIKE '5ml%'
    OR INV_DESCRIPTION LIKE '% 5ml%'
    

    Which will only update records that start with 5ml or have 5ml with a space before it, which would exclude 15ml or 25ml, etc.

    This is assuming SQL Server.

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

Sidebar

Related Questions

I have a WordPress blog with numerous URL's I wish to replace from this:
I have some contact information, in which I wish to wrap the telephone number
I am using the below code to replace some text which is working fine.
I have several applications that I wish to deploy using rpm. Some of the
I am writing an XSLT transformation in which I wish to use the Replace
I wish to test a function that will generate lorem ipsum text, but it
I have 40 subjects, of two groups, over 15 weeks, with some measured variable
I have a Drupal theme called wellington located in \sites\all\themes\wellington. I wish to override
i have the an IList and i wish to turn it into a ToArray()
I have a collection of objects that I wish to bind to a ListView

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.