what I mean is select distinctrow field_1,field_2,field_3 from table... this should give you what you need without combing through a resultset to identify unique records...
Example:
FIELD_1 FIELD_2 FIELD_3
1111 red small
1111 red medium
1111 red medium
the above query would give you
1111,red,small
1111,red,med
That sounds like what you are trying to do... let me know if I'm misunderstanding you. (Note that distinctrow is MS specific, I don't think it works in other databases.)