需求:有表table如下        id     name     age     sex  
                           111    张三     23       男
                           222         22       女
  我得到这张表的表头    id     name     age     sex  请问SQL怎么写(注意不是查数据,是表头)
select  ........

解决方案 »

  1.   


    select column_name
    from user_tab_columns
    where table_name='DEPT'COLUMN_NAME
    ------------------------------
    DEPTNO
    DNAME
    LOC
      

  2.   

    --查这个视图user_tab_cols也可以
    select * from user_tab_cols t where t.TABLE_NAME=upper('你的表名');另外还有all_xxx,dba_xxx视图
      

  3.   

    select column_namefrom user_tab_columns where table_name='TEST_TEMP'; 
      

  4.   

    select column_namefrom user_tab_columns where table_name='TEST_TEMP';