1 person found this helpful
you can use INSTR to get the position of the slash and then use SUBSTR.
But you should ask questions like this at SQL because this is the forum space for the tool SQL Developer.
select SUBSTR(col_value,1,INSTR(col_value,'/')-1) from your table;
As suggested by Marwin, post these type of questions in database related forums. This is for Sql Developer tool forum.
Better, I forgot the -1
but i also have value without / and they are not appearing through this query.
I didn't get you.
Provide sample data and required data
As I guess, you need like below.
if you have 5686890 then you need to display as it is, Right?
for that use this..
select SUBSTR(col_value,1,(decode(INSTR(col_value,'/'),0,length(col_value)+1,INSTR(col_value,'/')))-1) from dual;
Yes jagadekara you are right and result is ok now