Question

First_value() definition states that it returns the first value in an ordered data set. It's syntax is

First_Value(ColumnName) over ( [Partition By Colum] [Order by Column] )

The Partition By and Order By are optional. If partition by is removed, we get first value of whole set.

My question is what do we get if Order By is removed ?? Does oracle implicitly orders the set or just gives a random first value or gives the first value in order the data is inserted ?

Was it helpful?

Solution

Realistically, if you don't specify an ORDER BY, you'll get the data in the order that Oracle returns the result set. That's going to be arbitrary and subject to change as the query plan changes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top