SIGN UP MEMBER LOGIN:    
Blog

Display row number with rows in db2

Posted by Deepak Kumar Blogs | DB2 Apr 29, 2011
Here we learn, how to display row number for each rows in db2 with the help of an example.
Consider the contents of the table "TEMP" in given image -

ROWNUM1.gif

Now, we want to add row number in the result-set for each row. The given query is used to do so :

DB2 SELECT ROWNUMBER() OVER() AS ROWNUM, SCORE FROM TEMP

ROWNUM2.gif
share this blog :
post comment