Thread: sql
-
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.
-
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);
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|