create unique index i_PK_INVBASDOC on bd_invbasdoc(PK_INVBASDOC); select pk_invbasdoc from bd_invbasdoc where rownum<20001 and 1 = 1 and ( 1 = 1 ) order by PK_INVBASDOC asc drop index i_PK_INVBASDOC; select pk_invbasdoc from bd_invbasdoc where rownum<20001 and 1 = 1 and ( 1 = 1 ) order by PK_INVBASDOC asc
对oracle不熟悉的同学:rownum是一个伪列,它取得第一条记录则rownum值为1,第二条为2,一次类推,不是真实的数据库列