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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:50:06+00:00 2026-05-28T05:50:06+00:00

I have a field that contains mixed data with an id number that I

  • 0

I have a field that contains mixed data with an id number that I want extract to another column. The column I wish to extract from has some records that match the format ‘lastname, firstname-ID’. I only want to strip the ‘ID’ part, and from those columns who have a ‘-‘ and numbers following it.

So what I was trying to do was…

update data.xml_customerqueryrs
set new_id = regexp_replace(name, '[a-z]A-Z]', '')
where name like '%-%';

I know there is something minor that I need to fix, but I am not sure as the postgresql documentation for pattern matching doesn’t really do a good job covering searching for only numerics.

  • 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-28T05:50:07+00:00Added an answer on May 28, 2026 at 5:50 am

    Or you can also do:

    new_id = substr(name, strpos(name, '-'), length(name)) 
    

    Ref: Strings

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

Sidebar

Related Questions

I have a field that contains data like below: 124.97#54.03#5#16 its number which separated
I have an SQL Server 2005 table that has a varchar(250) field which contains
I have a varchar(1000) column declared as field that contains all numbers, as shown
I have a combination field that contains a query.I want to speed up my
I have a Model called statistics which has a value field that contains Goals
I have a field that contains strings such as 'Blah-OVER', 'Blah-OveR', etc. and want
In my database, I have a text field that contains escaped data: O'Neal I
I have a data field that contains large numbers in two formats: 553000.468...705.46.0000000 <-
I have field that contains a comma-separated list. Some old records have a comma
I have field X that contains text with spaces in the end of the

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.