Fix for buildQuery select with table alias