title: Random number based on a group and should not to equal to row number generated in Oracle
body: <p>I have a requirement to Swap the records within a group and generated random number not to be same as Row_number. I cannot write Stored Procedure, it should be with SQL</p>
  
  <p>Ex:</p>
  
  <pre><code>Row_number  Group     Desired O/pRandom_number  
  1            1         3
  2            1         4
  3            1         2
  4            1         1
  1            2         2
  2            2         1
  3            3         4
  4            3         5
  5            3         3
  </code></pre>
  
  <p>I tried to calculate max and min within each group and generate the random numbers and everything looks fine. Issue is sometimes same random number will be assigned to row_number. I always want the random numbers and row_number to be always different</p>