This content has been marked as final. Show 4 replies
Here's one way:
Edited by: Frank Kulash on Dec 31, 2012 6:15 AM
WITH got_pound_pos AS ( SELECT str , INSTR (str, '#') AS pound_pos FROM t ) SELECT str FROM got_pound_pos WHERE SUBSTR (str, 1, pound_pos - 1) = SUBSTR (str, pound_pos + 1) ;
Another way is to use regular expresssions:
but this will be slower than using INSTR and SUBSTR.
SELECT str FROM t WHERE REGEXP_LIKE ( str , '^(.+)#\1$' ) ;