我想查询几个常数,如:select 1,2,3,4 from A
得到的结果是:Expr1  Expr2  Expr3  Expr4
              1      2      3      4我想得到的结果是:Expr1
                  1
                  2
                  3
                  4
即是4条数据这个sql如何写??

解决方案 »

  1.   

    其实你应该查一个表的数据,只是要多一列显示序号吧,select *,rownum from table 这样就可以
      

  2.   


    你可以 select 1  from table
          union
          select 2  from table
          union
          select 3  from table
          union
          select 4  from table
          
      

  3.   

    select 1 as Expr1 from A 
    union
    select 2 as Expr1 from A 
    union
    select 3 as Expr1 from A 
    union
    select 4 as Expr1 from A 
    不知道行不行