想列出如下的记录,该如何做
index month
1      01
2      02
3      03
4      04
5      05
6      06
7      07
8      08
9      09
10     10
11     11
12     12怎么实现,急

解决方案 »

  1.   

    原先表里只有各一个productID,对于每个productID想等到像这样的一个结果productID index month 
    12345      1      01 
    12345      2      02 
    12345      3      03 
    12345      4      04 
    12345      5      05 
    12345      6      06 
    12345      7      07 
    12345      8      08 
    12345      9      09 
    12345      10    10 
    12345      11    11 
    12345      12    12 急,请帮忙
      

  2.   

    select distinct substr(to_char(日期字段,'YYYYMM'),5,2) mm
    from tb
      

  3.   


    select productid, rn index, lpad(rn, '0', 2) month from products, (
    select rownum rn from user_tab_cols where rownum<=12)
      

  4.   

    SELECT DISTINCT INDEX,MONTH FROM yourtable
      

  5.   


    select lpad(level,2,0) month from dual 
    connect by level<13
      

  6.   


    select lpad(level,2,0) month from dual 
    connect by level<13