Posted By

geekzspot on 12/01/12


Tagged


Versions (?)

Oracle Random Character from a String


 / Published in: SQL
 

To produce a random character from a specific list of characters (for example 'x', 'y' or 'z')

  1. SELECT SUBSTR('xyz',ROUND(DBMS_RANDOM.VALUE(1,3)),1) FROM DUAL; -- where 3 is the length of the string 'xyz'.

Report this snippet  

You need to login to post a comment.