Which pattern is identified by PATINDEX in the below statement? Could any one help me analyse it?
How can we find which of (‘I’,’II’,’III’) is identified ?
select PATINDEX ('%[I,II,III]%','sjfhasjdg II')
Please help me finding it.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is not how you use
PATINDEX.,is not an alternation operator.You are telling it to find characters in the set
I,II,IIIwhich just repeats a lot of characters so can be simplified to “find the first location of eitherIor,“You could try
Returns
Of course both
IandIImatch as anything that matches the second will always match the first.