SQL - Find substring in char string

Associate
Joined
23 Aug 2004
Posts
1,493
Say i have a string

str = 'abcdefghij.......z',

Is there a function that, given a substring of str (such as 'abc') , would return all of a?

Sorry if it's a stupid question, I cannot find anything on google.
 
I think you are looking for LIKE:

SELECT STR
FROM FILE_A
WHERE STR LIKE '%abc%'

This will return all STR strings from your file that contain abc anywhere in the field. If you only want those beginning with abc use 'abc%'.
 
Back
Top Bottom