我要查询当前用户的所有表以及表注释的sql应该怎么写呢select table_name,comment from user_tables大家帮我看看这条sql错在哪里

解决方案 »

  1.   

    user_tables里没有comment字段
    想看注释的话
    select * from user_tab_comments
      

  2.   

    SQL> select a.table_name,b.comments
      2  from user_tables a,user_tab_comments b
      3  where a.table_name=b.table_name;TABLE_NAME           COMMENTS
    -------------------- --------------------
    DEPT
    EMP
    BONUS
    SALGRADESQL>
      

  3.   

    我晕
    既然b表也有table_name这个字段
    为何还要去user_tables表中连接..
      

  4.   

    楼主表查询错了,应该是:
    select table_name,comments from user_tab_comments