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

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

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

java - Cannot secure connection using TLS -