vendredi 20 janvier 2017

SQL Sampling based on the whole population

I have a population of records...let's say 10,000 athletes, grouped by sports, where: 4,000 are from NBA 2,000 are from NHL 3,000 are from MLB 1,000 are from NFL

How can I build a sample query that will sample 100 records based on the population, not fully random but pull out: 40 names are from NBA 20 names are from NHL 30 names are from MLB 10 names are from NFL.

Let me know if anyone knows how to do this?

Regards




Aucun commentaire:

Enregistrer un commentaire