Sample Records

SRAB

Is it Friday?
Local time
Today, 18:40
Joined
Jul 6, 2006
Messages
31
I've read-up on getting random records, but I need a little help.

I have a table with 200,000 SSN records. Fields: SSN, Plan Number
There are about 100 distinct plans.
How can I select a sample (random) SSN for each plan?:confused:
 
You are of course correct. It will take a better understand of SQL than I have to answer your question.
 
Well the solution for this dawned on me this weekend, and it was so simple as to be embarrasing...:rolleyes: but I'll leave it here for others who are looking. min or max will result in only one record for each of the plans.

SELECT [Plan Number], Min([SSN]) AS MinOfSSN
FROM [TABLE_NAME]
GROUP BY [Plan Number];
 
Thanks for posting back with your success. That does not look particulary random but if it works for you then great!
 
Thanks for posting back with your success. That does not look particulary random but if it works for you then great!

Random being "any" record, it did the trick.
 

Users who are viewing this thread

Back
Top Bottom