Generate random values in oracle view

Vinod Chelladurai

I have a table like shown in picture. For a distinct combination of VALUE1 and VALUE2 Columns, i have several steps. So, I want a view showing the number of each step based on the order they arrive. For example, STEP1 arrives first and so it's step number in the view should be 1 and so on. Kindly heklp me on this aspect. Thanks in advance.

enter image description here

Florin Ghita

What you ask can pe done with:

select value1, value2, step, row_number() over (partition by value1, value2 order by rn)
from 
    (select value1, value2, step, rownum as rn
    from table
    --an order by recommended
)

But I strongly recommend to give an order by to the query. The "the order they arrive" is not an order in a DBMS.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to generate a random char in oracle

Generate random values given a PDF

Generate random values from boxplot

r generate random poisson values

Generate a random html hex color with Oracle SQL

Generate random percentage using oracle sql

Generate new random values and store in an array

JavaScript generate random number except some values

How to generate N random values with SELECT?

Generate random values based on a seed Swift 3

How to generate random values for a predefined function?

When does SQLite RANDOM() generate values?

Generate a matrix without 0 values in a random way

Generate random doubles in between a range of values - Java

Random generate three integer values and check if they are unique

How to generate random values from a string in python?

How can we generate random values in Scrypto?

Generate Valid Random Faker Values in Go

How to generate a matrix of random values with zeros on the diagonal?

Javascript Using Math.random to generate random rgba values in for loop

How to generate random values that are distant from a list of values?

Need to generate random numbers between two values ignoring the given values

Generate n random values from a specific mean and range values

How to generate a list of random values excluding values in another list

Oracle : Generate rows with slightly different values in a column

Generate duplicate rows with incremental values in Oracle

How do I generate random sample data in my Oracle database?

Generate random password for Oracle user using shell script

Generate random Google Maps street view coordinates in JavaScript

TOP Ranking

HotTag

Archive