I am using below SQL statement. The below systimestamp displays the same seconds values for all the records. The table contains one million records. How can we displays the seconds or nano seconds variations for each records? OR any other methods to differentiate the seconds in time for each record?
SELECT ITEM,ITEM_NO,DESCRIPTON,SYSTIMESTAMP FROM ITEM_MASTER ORDER BY ITEM_NO;
SYSTIMESTAMPreturns the same time for all rows; it does not return the time each row was read from a data file or put into the result set. Therefore what you are asking is impossible.If you want to have a unique identifier for the order that the rows were put into the result set then use the
ROWNUMpseudo-column:If you want the rows to be numbered in the same order as the output then order first and then apply
ROWNUM:or use the
ROW_NUMBERanalytic function:If you want to convert that to a timestamp that is artificially incremented by a micro-second for each row then:
This appears to be an XY-problem; you do not need to use a time and the order of a result set is not guaranteed without an
ORDER BYclause so if you want to use theITEM_NOorder then you already have a pre-existing column you can use to order the rows and do not need to artificially generate a "time" column.