with tbl as (select 'Boston city' as name from dual) select name, substr(name, 1, instr(name,' ',-1)-1 ) simple_name from tbl; NAME SIMPLE_NAME ----------- ----------- Boston city Boston
Popular Topics
Popular Topics
Showing posts with label Remove the Last Word From a String Using Oracle SQL. Show all posts
Showing posts with label Remove the Last Word From a String Using Oracle SQL. Show all posts
Monday, December 17, 2018
Remove the Last Word From a String Using Oracle SQL
I use the following query to remove the last word of a sentence.
Subscribe to:
Posts (Atom)