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

Thread: sql

  1. #1
    Join Date
    Sep 2000
    Posts
    23
    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???

    Cheers

    Doug.

  2. #2
    Join Date
    Nov 1999
    Location
    Elbert, Colorado, USA
    Posts
    81
    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
    Posts
    6
    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