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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:13:20+00:00 2026-06-13T03:13:20+00:00

I am trying to update my product database and find duplicates after some product

  • 0

I am trying to update my product database and find duplicates after some product numbers where changed.

In the past the changed item numbers just had an extra dash and number or letter on the end and I used this where clause:

where a.ProdNum REGEXP CONCAT('^', b.ProdNum, '(\-|\s)[a-zA-Z0-9]+')

Now the REGEXP is over my head.

Old Product number: BRB-0325

New Product number: 0325-15 (the number after the dash can be any 1 or 2 digit number)

So basically I need a where clause that will drop the “BRB-” from the Old Number and drop any 1 or 2 digit number after the new item number.

I can do the dropping of the “BRB-“, but not sure how to handle dealing with the 1-2 digit number, and I really don’t know how to do both at the same time.

where b.ProdNum = CONCAT('BRB-', c.ProdNum)

Here is what I tried with the 2 digits and that didn’t work.

where c.ProdNum REGEXP CONCAT('^', b.ProdNum, '(\-)[0-9]{1,2}+')

Thanks for your help.

  • 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-13T03:13:22+00:00Added an answer on June 13, 2026 at 3:13 am

    Assuming c.ProdNum is the new number and b.ProdNum is the old:

    WHERE CONCAT('BRB-', c.ProdNum) REGEXP CONCAT('^', b.ProdNum, '-[0-9]{1,2}$')
    

    This adds “BRB-” to the new number and compares it to the old. So you will be essentially comparing “BRB-0325-15” with “BRB-0325-nn”.

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

Sidebar

Related Questions

Im trying to update the contents of an element after running some php code.
I'm trying to update an array element in Java. Some sort of a database
Trying to update a database records when a user hits a submit button with
I'm trying to fix some errors on a big database of stock exchange data.
We have recently had to do some work with an OpenEdge database that a
I'm trying to update a field in my database with 1 each time the
I am Trying to update my table (product) columns - ProductID(FK) and ProductType(FK). These
I am trying to insert a new product into my database, although I am
I am trying to update an whole entity object with relations in database in
UPDATE: I've come across this question I did after some years: now I know

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.