Query to be used to find substring in a column