Looping over a query

From: Chris (christopher_at_reardenweb.com)
Date: 09/07/04


Date: Tue, 7 Sep 2004 10:21:18 -0500

Hi all,

I have a question on looping over results. I have the following select
statement:

SELECT FactorLabel
FROM RFMFactorLabels
WHERE ClientKey = @ClientKey

The results would be something like:
Frequency Group 1
Frequency Group 2
Frequency Group 3
Frequency Group 4
Frequency Group 5

There will always be 5 results and only 5. I need to loop over the results
and set them as:
@Group 1 = "the first result"
@Group2 = "the second result" and so on and so on.

Can someone point me in the right direction?

Thanks.