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 - Ebean enhancement ignores a model -

javascript - Reference error while trying to encapsulate an animation function -

SQL php on different pages to Insert (mysqli) -