Added methods for executing distinct queries.