比如select * from a取得显示出来的列的数量

解决方案 »

  1.   

    select count(*) from user_tab_columns where table_name='A';
      

  2.   

    不是这个意思
    我的意思是
    select * from xx,yy
    针对上面这个结果集来找他们的总列数
      

  3.   

    关注可以算是动态sql的范畴
    dbms_sql好像可以好多前台平台提供的数据对象可以访问或分析结果集的列数
      

  4.   

    select * ,count(*) sum from xx,yy
      

  5.   

    select count(*) from user_tab_columns where table_name in upper('xx','yy');
      

  6.   

    SQL> select * from tmp
      2  /NAMES                COURSE                   GRADE
    -------------------- -------------------- ---------
    a                    语文                          62
    b                    语文                          70
    c                    语文                          80
    a                    数学                          90
    b                    数学                          95
    c                    数学                          75
    a                    英语                          85
    b                    英语                          92
    c                    英语                          959 rows selected.SQL> select count(*) from user_tab_columns where table_name = 'TMP'
      2  / COUNT(*)
    ---------
            3SQL> select * from tmp1
      2  /NAMES                    GRADE
    -------------------- ---------
    a                           62
    a                           90
    a                           85SQL> select count(*) from user_tab_columns where table_name = 'TMP1'
      2  / COUNT(*)
    ---------
            2SQL>
      

  7.   

    re 请问,如何取得一个select语句的列数?
        借助于一个中间表,通过变通的方法,取得一个select语句的列数    参看http://hi.baidu.com/zhao_e893/blog/item/173d150808047730e924882b.html