We have a SqlDataSetDefinition whose SQL contains:
This is bad SQL (I'm surprised MySQL doesn't complain).
It used to be the case that the code behind SqlDataSetEvaluator would handle this "nicely", however since the recent refactoring, it's now the case that the last column value will be displayed in all columns in the output.
I suggest that the correct behavior should be to fail evaluation if two columns have the same name. I think this would happen in org.openmrs.module.reporting.evaluation.service.EvaluationServiceImpl#getColumns(QueryBuilder)