mercredi 10 février 2021

Get random sample of customer IDs that meet multiple conditions

I have a SQL table of customer data including the following columns:

ID, age, postcode, sign up method

I need to get a random sample of this data that meet a number of conditions:

  • 20% one age group, 30% another age group
  • 50 % female
  • x% one region, y% another region, z% another region etc.

Does anyone know how I can do this? I have created random samples before but not with these kind of conditions




Aucun commentaire:

Enregistrer un commentaire