Quantcast
Viewing latest article 1
Browse Latest Browse All 5

Answer by Art for SQL to remove partial text from value

Here's another example that should work in any SQL as functions used are ANSI SQL standard. This example assumes that there is a whitespace between word 'WEB' and first digit. But it can be improved. I think this is more generic approach then hardcoding start and end positions for subtr:

SELECT TRIM(SUBSTR('WEB 1.0.1', INSTR('WEB 1.0.1', ' ') ) ) as version 
  FROM dual;

 SQL> 

 VERSION
 -------
 1.0.1

Viewing latest article 1
Browse Latest Browse All 5

Trending Articles