How to escape underscore character in PATINDEX pattern argument?

后端 未结 3 933
南笙
南笙 2020-12-24 01:54

I\'ve found a solution for finding the position of an underscore with PATINDEX :

DECLARE @a VARCHAR(10)  
SET     @a = \'37_21\'

PRINT PATINDEX(\'%_%\', @a)         


        
3条回答
提交回复
热议问题