Splitting Attributes

Posted on 16th Feb 2014 by admin

SQL> SELECT I_NAME, substr(I_NAME,1,instr(I_NAME,'O')) "First part",

substr(I_NAME, INSTR(I_NAME,'O')+1) "Second part"

FROM Enrollment

WHERE I_NAME like '%O%';
2 3 4

I_NAME First part Second part

--------------------
LIOU LIO U

I am just not sure why it’s only pulling one name from the table.

Other forums