Want to create serial numbers

后端 未结 1 462
一个人的身影
一个人的身影 2021-01-26 11:51

I want to generate the serial no.s

e.g.

I have,

NID
----- 
ABD90
BGJ89
HSA76

and I want,

ID NID
---------
1          


        
相关标签:
1条回答
  • Since you tagged SAS, I'll answer with SAS.

    Based on your question, getting that result from that input would be as simple as this

    data result;
      ID=_N_;
      set input;
    run;
    

    or

    proc sql;
      select ID as monotonic()
            ,NID
      from input
      ;
    quit;
    

    In pure Oracle you would do this

    select rownum, NID
    from input
    

    However you might want to throw on ORDER BY in there because you'll likely get different results every time you run that.

    0 讨论(0)
提交回复
热议问题