I have a report where I need to get a random set <= 35 per group. I work in Sybase Rapid SQL so there are some functions that do not work in there.
This one works fine but I can't get it to reset for each group (prsn_id)
tmp_rownum numeric(10,0) identity
Select TOP does not work. Does anyone have a suggestive approach?
Ideally, I would like the result set to find all the records but limit it to no more than 35 record rows per prsn_id. Should I be using a @counter loop assign a row number and reset each time the prsn_id changes? Is this something I can do from a temp table?