I have a large database and I need to sample records from it based upon the user ID in each record. The problem is I need four records for each user. I can ge the whole list for all users. I can get four records for one user btu I cannot get 4 records for all users. The only solution I have come up with is below:
SELECT TOP 4 tblMatchedVolume.Underwriter_ID, tblMatchedVolume.Loan_Type_Code, tblMatchedVolume.Mortgage_Loan_No___10_Character, Date() AS [Review Month]
FROM tblMatchedVolume INNER JOIN _TblActiveUW ON tblMatchedVolume.Underwriter_ID = [_TblActiveUW].OPID
WHERE (((tblMatchedVolume.Underwriter_ID)=[Enter ID]));
I have approx. 273 users and I don;t want to run this 273 times. Any ideas?
Thanks.