I’ve a column which contains strings
like
id fruit
1 apple
2 mango
3 banana
4 grapes
5 watermelon
I need to iterate through the fruit row to find out where is ascii value of a which is 97.
like in id=1 apple contains 'a'=97 so i want to print the position of character a in all
rows by comparing it with ascii value 97.
can anybody tell me how to iterate through each row to compare with ascii value 97?
This uses the
CHARINDEXfunction, which gives the first position of a character within a string, and theCHAR()function, which returns a character assigned to the ascii value given.