This will work for the sample data, only checks the first 3 characters.
SELECT * FROM cities
WHERE SUBSTR(Name,1,1) = SUBSTR(Name,2,1)
AND SUBSTR(Name,2,1) = SUBSTR(Name,3,1);
Question
Assume I have city field with the given values:
I would like to run a sql query that return cities that have three or more consecutive characters that is row #3 and row #4
characters might be:
My rough attempt; I didn't test the code yet:
SELECT * FROM table WHERE REGEXP_LIKE(city,'[[:space:|x|-]]+')
Thanks
Solution
This will work for the sample data, only checks the first 3 characters.
SELECT * FROM cities
WHERE SUBSTR(Name,1,1) = SUBSTR(Name,2,1)
AND SUBSTR(Name,2,1) = SUBSTR(Name,3,1);