oracle - drop everything to the right of a hyphen in sql -


i using oracle sql developer 2012. data looks 'valuea-valueb'. want strip content after - , populate rest.

you can use combination of substr , instr:

select substr(my_column, 1, instr(my_column, '-') - 1)   my_table 

Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -