select * from (select my_table.*,rownum as my_rownum from (select * from 人力资源档案卡 A,人力资源档案卡_工作经历 B where A.身份证号码=B.身份证号码)  as my_table where rownum<='10') as ww where my_rownum>'0'

解决方案 »

  1.   


    你缺了个字段 rownum 应该是:
    select * from (select my_table.*,rownum as my_rownum from (select rownum,* from 人力资源档案卡 A,人力资源档案卡_工作经历 B where A.身份证号码=B.身份证号码) my_table where rownum<='10') where my_rownum>'0' 
      

  2.   

    是不是在表人力资源档案卡,人力资源档案卡_工作经历这2个表中都有列“my_rownum”
      

  3.   

    为什么这个语句就能使用呢select * from (select my_table.*,rownum as my_rownum from (select * from 人力资源档案卡) my_table where rownum<='10') where my_rownum>'0'
      

  4.   

    select * from (select my_table.*,rownum as my_rownum from (select * from 人力资源档案卡 A,人力资源档案卡_工作经历 B where A.身份证号码=B.身份证号码)  as my_table where rownum<='10') as ww where my_rownum>'0'语句本身是没有错的.
    select * from 人力资源档案卡 A,人力资源档案卡_工作经历 B where A.身份证号码=B.身份证号码
    有重复字段导致的.
    改成
    select A.* from 人力资源档案卡 A,人力资源档案卡_工作经历 B where A.身份证号码=B.身份证号码
    试试
      

  5.   

    ORACLE的每个查询,包括查询中的子查询,都会有一个rownum列,如果你在外层查询中直接使用rownum就是当前查询结果中的rownum,要使用子查询中的rownum一定要使用他的别名!