Hi Steve,
If you want to display the data in crystal report then try the "Suppress Duplicate Value" option of crystal report. Else in SQL you can try with table variable. Create one table variable (which act as table), insert your result in that table and update that table using loop logic. Hope this will help to resolve your issue.
Regards
Manoj