fixed search sql