lundi 4 janvier 2021

Randomly pick one distinct row of every group?

Let say I have this SQL in Oracle :

 select field1,field2 from table where field2 in (32,421,5766) and .....

it normally will return many rows. How do I pick 3 random rows ONE from every group that is defined by field2 and also match the rest of the conditions




Aucun commentaire:

Enregistrer un commentaire