-3

help to get output as 2000 where input value is 2000/100

I want whole strings before /

input 2000/100
output 2000
Barbaros Özhan
  • 59,113
  • 10
  • 31
  • 55
Nidhi
  • 1

1 Answers1

0

Two simple options (based on what you described):

SQL> with test (col) as
  2    (select '2000/100' from dual)
  3  select col,
  4    regexp_substr(col, '\w+')           option_1,
  5    substr(col, 1, instr(col, '/') - 1) option_2
  6  from test;

COL      OPTION_1 OPTION_2
-------- -------- --------
2000/100 2000     2000

SQL>
Littlefoot
  • 131,892
  • 15
  • 35
  • 57