Removes alias code from query