Unanswered: applying RAND to a few columns of total result set
Hi- trying to figure out how to use RAND.
I am building a temporary table then applying RAND to the result set to pull back a sample. I have a total of 10 fields, but I only want to apply RAND to 3 of the ten columns, is there an easy way to do that?
Here is my last statement:
Select CaseType,ServiceType,AuthorizationType,ReviewType, CaseReferenceNum,
ServiceBeginDt,ServiceEndDt,DenialType,MemberID,Re portingCategory, RAND() as RID
ORDER BY RID
FETCH FIRST 125 ROWS ONLY
I need to pull back all of these fields. But applying RAND to all of them isn't making my selection complete enough. I need to have a good selection of ServiceType, ReviewType, and DenialType. Do I need to do a sub query? Or can I apply RAND to just those three columns, leaving in the remaining columns?