Implements query_one()