Implement raw query