grep search sql fix