Wednesday, November 24, 2010

Oracle SQL to split field

Ok so I needed to split a field in an Oracle DB into two fields in a new view I was creating. This is the SQL I used:

select entitlement_data,
  substr(entitlement_data,0,instr(entitlement_data,':')-1) ENT_NAME,
  substr(entitlement_data,instr(entitlement_data,':')+1,length(entitlement_data)) ENT_VAL
from arm_user_entitlements

No comments:

Followers