vendredi 20 janvier 2017

Case when Random.Value

My query is built on multiple 'case when' statements, and I am trying to add a random sample of about 10 records to this mix.

I guess I'm looking for something like:

 Case when (select dbms_random.random DOC_NUM (x10) then 'Random' else '-' end rand_doc

If something like that is possible in a case when?

There's no specific criteria I want to look for, but if it helps in a case when statement then I can add 'doc_num Like '%5%'' for example, as this would still give me a decent random sample (as the doc_num is 8 numbers long)

Output example:

12345678 'random'
12346789 '-'
12348790 '-'
21212120 '-'
65656565 'random'




Aucun commentaire:

Enregistrer un commentaire