The "fish"...
SELECT substr( string_column, INSTR( string_column, 'A^') + 2, INSTR( string_column, ',') ) columnA,
substr( string_column, INSTR( string_column, 'B^') + 2, INSTR( string_column, ',', 2) ) columnB,
substr( string_column, INSTR( string_column, 'C^') + 2 ) columnC
FROM your_table
Now, teaching you to fish...
INSTR( string_column, 'A^') returns the position in <string_column> of the literal 'A^'
INSTR( string_column, ',', 2) returns the position in <string_column> of the second occurence of literal ','
SUBSTR( string_column, position ) returns the substring starting at position to the end of the string.
Main Topics
Browse All Topics





by: sujit_kumarPosted on 2007-08-02 at 13:28:02ID: 19620579
try this,
-- For A^
select substr(<your column>, 3) result from <your table> where <your column> like 'A^%';
For example,
select substr(col1, 3) result from tab1 where col1 like 'A^%';