I have a string @x='2,12,13,1' and now i have to find out whether 2 is exists in the string @x. I have tried using of length function as below.
@st=2;
if((LENGTH(@x) - LENGTH(REPLACE(@x, @st, '')))/LENGTH(@st)=1)
return 1;
else return 0;
if it returns 1 then string exists but it is not working as expected. pls let me know is their any other method implement this feature. Thanks.