search in two tables query implement