Truncating String in sql query
I'm having one location table where the values of location are returned as KC_KansasCity,CHAR_Charlotte,PEW_Pewauke etc,I want to truncate the characters before underscore and also underscore while inserting the data into table.
i.e for Eg:I've to ignore KC_ and insert only KansaCity into the table.
Can anybody advise me on how to do this..
Use something like this:
substr('CHAR_Charlotte', instr('CHAR_Charlotte', '_', 1)+1)
I'm assuming a single underscore in the names.
Click Here to Expand Forum to Full Width