DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: sql

Hybrid View

  1. #1
    Join Date
    Sep 2000
    Hi guys,

    I was wondering if anyone could give me a help here?

    I have a customer order number field in one of the tables.
    It looks like this

    Cust Ord
    C17475676 LM OE99
    C12345687 LM SD87
    C98754123 LM CB87

    I want to strip out the LM in the data. So the data should look like this

    Cust Ord
    C17475676 OE99
    C12345687 SD87
    C98754123 CB87

    I have spent most of the second part of my messing about trying find out how to do this but to no avail.

    Any idea's???



  2. #2
    Join Date
    Nov 1999
    Elbert, Colorado, USA
    IF all of the data is formatted as nicely as your example, you could try something like

    UPDATE my_table
    SET ord_num = substr(ord_num,1,10)||substr(ord_num,-4,4);

  3. #3
    Join Date
    Oct 2000
    Or you could try the REPLACE function and have null as your replacement string.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.