Hope I explain this correctly. I have the following query that is looking at a specific record but I have around 65K records to loop over
[code language="sql"]
select * from Contract_priormonth C
[code language="sql"]
select * from Contract_priormonth C