I am trying to use this ROW_NUMBER in db2 for insertion.This is working fine ,but in the output I am unable to find the row_id in ascending order.
this is my query
INSERT INTO FR (SELECT ROW_NUMBER() OVER(), A.SERVER as DB_NAME,A.CREATOR,A.TABLE_NAME,A.COLUMN_NAME,A.COL TYPE,A.NULLS,A.LENGTH,A.IDENTITY ,B.TABLE_COUNT
FROM FR_STAGE A full OUTER JOIN M_ROWCOUNT B ON A.TABLE_NAME=B.TABLE_NAME )';
can any one please let me know where should I mention the Order By clause for the ROWID.
how about select .. from table .. order by xx to produce the output
order by 1 can also be used
see doc for this basic detail...
Best Regards, Guy Przytula
Database Software Consultant
Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
Information Server Datastage Certified http://www.infocura.be