pattern matching in redshift

0

there is a text and i would need to find the word SUBSTR(
How can i acheive?

KN
asked a year ago180 views
1 Answer
1

You can use the position or charindex functions.

dev=# select position('SUBSTR(' in 'jakjasf;kljksfjdsSUBSTR(kjasdkjadsjfjk');
 position 
----------
       18
(1 row)

dev=# select charindex('SUBSTR(', 'jakjasf;kljksfjdsSUBSTR(kjasdkjadsjfjk');
 charindex 
-----------
        18
(1 row)
profile pictureAWS
EXPERT
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions