I need to output the value of an image rotating every 8 rows. My plan is to use a RowID with a series of CASE statements to output that image name. I'm having problems with the algorithm behind it, though. I need something like this:
c.contact_id AS CID,
FROM contacts c
WHEN RowID/RowID = 0 THEN 'hahaha' ELSE 'boo!'
* FROM CONTACTS2
Obviously this is wrong, as every row will output "boo!". The logic should be "if the RowID corresponds to the first position in that 8-row set, then output the first image. If it's the second RowID (ie: RowID=10) of the 8-row set, then output image 2", etc. Make sense?