Avoiding SQL errors by prefixing columns with the Table alias

fixes #4508