refactoring whereToSql; add limit statement
sadness