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 -

ubuntu - How to disable Kernel Module Signing in linux -

SQL php on different pages to Insert (mysqli) -