juliocamarero/liferay-portal — pull request #1440 by epgarcia (2013-03-04 13:33:29+00:00)
Title: LPS-32143 Fix non compatible SQL query

All the fields named in the select list must be named in the group by clause. For fields which may have multiple values in the same group, a single value criteria must be forced. Thus for userId and userName (which may have multiple values for the same resourcePrimKey, groupId, companyId, nodeId group) the MIN function is used to select a single value.