【问题标题】:If I turn a collection of Number into a table, what's the name of the column? 10gR2如果我将一个数字集合变成一个表格,那么该列的名称是什么? 10gR2
【发布时间】:2010-09-21 04:43:43
【问题描述】:

如果我想将 * 替换为列名,会是什么?

create type mytable$t as table of number;
/

declare 

mytmou  mytable$t := myTable$T();

cnt pls_integer ;

begin

    mytmou := myTable$T(1,2,3,4,5,6);

    SELECT count(*) into cnt From Table (mytmou);

    dbms_output.put_line(cnt);

end;

6

【问题讨论】:

    标签: sql oracle collections


    【解决方案1】:

    COLUMN_VALUE是列名

    SQL> ed
    Wrote file afiedt.buf
    
      1  declare
      2    mytmou  mytable$t := myTable$T();
      3    cnt pls_integer ;
      4  begin
      5      mytmou := myTable$T(1,2,3,4,5,6);
      6      SELECT count(column_value) into cnt From Table (mytmou);
      7      dbms_output.put_line(cnt);
      8* end;
    SQL> /
    6
    
    PL/SQL procedure successfully completed.
    

    【讨论】:

    • 该死的摇滚。我要创办贾斯汀洞穴粉丝俱乐部
    猜你喜欢
    • 2013-05-21
    • 2017-03-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-14
    • 1970-01-01
    • 2017-05-11
    • 2012-12-02
    相关资源
    最近更新 更多