How do I write a query that outputs the row number as a column? This is DB2 SQL on an iSeries.
eg if I have
table Beatles:
John Paul George Ringo
SELECT ROW_NUMBER() OVER(ORDER BY BEATLE_NAME) ROWNUM,BEATLE_NAME FROM BEATLES;