Since you apparently have MSSQL handy, could you maybe check if there are characters e.g. '\0' which are probably never used for values, are valid to be concatenated? I could imagine that Hibernate could render something like count(distinct col1 || '\0' || col2) for dialects that don't support tuple distinct counts. Maybe the character can even be made configurable. |