是不是两条查询中间其他session插入并提交了一些记录?

解决方案 »

  1.   

    试试这个看看:
    select count(*)
    from (
    select * from viewtassets
    )a看看是不是和select count(*) from viewtassets 一样。
      

  2.   

    我觉得更可能是楼主在两个session中分别执行了这条语句,并且在执行第二条语句的session插入了记录,但没有commit
      

  3.   

    哦,
    很有可能是2个之间插入了数据操作!!!!
    看看PL/SQL里的那个commit按钮有没有灰掉啊!!!
      

  4.   

    select count(*) from viewpoassets where leid in(1,2)   --2747
    select *        from viewpoassets where leid in(1,2)   --1667  
    不可能在session中间查,数据库重起了还是这样,对了,是在pl/sql developer中查询的
      

  5.   

    离谱了:select count(*)
    from (
    select * from viewpoassets
    )a    --6400
      

  6.   

    select count(*)
    from (
    select * from viewpoassets where leid in(1,2) 
    )a  --1667
      

  7.   

    证明:select *        from viewpoassets where leid in(1,2)   --1667  
    select distinct * from viewpoassets where leid in(1,2) --1667
    select count(*) from viewpoassets where leid in(1,2)   --2747
      

  8.   

    在java中访问select *        from viewpoassets where leid in(1,2)   --2747
      

  9.   

    最终原因是viewpoassets所涉及一个表location只有两个字段,但这两个字段上设了个联合主键,就因为这个出了问题,删掉就好了,高手接分呀!
      

  10.   

    select PurchaseApp.LEID , viewLocation.LEID,PurchaseApp.Location , viewLocation.Lcode from  
          PurchaseApp LEFT OUTER JOIN viewLocation ON 
          (PurchaseApp.LEID = viewLocation.LEID AND PurchaseApp.Location = viewLocation.Lcode)
    显示出来PurchaseApp.LEID , viewLocation.LEID不等,有没有人遇到过这个问题?