mardi 8 septembre 2020

Partition on SQL with random sampling

I have a database like this:

enter image description here

How can I get a random sample of for example 2 rows of New York City and 3 random rows of London? Do some one know a simple and short code for this?

I am thinking of using row () over (partition by City order by City) but how to move on?




Aucun commentaire:

Enregistrer un commentaire