table refactor sqlSelect