There are situations where we want to distinct by only part of the attributes in the select. On those situation we don't care which values will be on the other attributes.
We found online that the way to do it is to group by the attributes we want to distinct by.
Is it a good way? and if not, can you suggest better way (a simple one and not lots of nested queries - it is not efficient)