select * from table_name where rowid=(select last_value(rowid) from table_name);

解决方案 »

  1.   

    sorry:
    select * from table_name where rowid=(select last_value(rowid) over(order by rownum) from table_name where rownum=1);
      

  2.   

    什么最后一条?
    ORACLE里的记录没有前后分别
      

  3.   

    我指得是 最后插入的一条记录请问如何用sql语句查出来
      

  4.   

    试一下下面的语句,应该可以:
    select * from table_name where rowid=(select rowid from (select rowid from table_name order by rowid desc) where rownum=1)
    我刚学Oracle,有什么问题请大家提出来,相互提高。
      

  5.   

    select rowid,a.* from table_name a where rowid=(select max(rowid) from table_name);
    rowid是最大的一条才是最近的记录。
      

  6.   

    rowid最大不一定最后记录
    select * from table_name where rowid=(select rowid from (select last_value(rowid) over(order by rownum) rowid from table_name) where rownum=1);
      

  7.   

    不可能的  你上 asktom上看看 
    除非表中有 时间 sequence 的字段标示先后
      

  8.   


    to beckhambobo(beckham) 你的那个语句出错:SQL> select * from tjh_test where rowid=(select rowid from (select last_value(rowid) over(order by r
    ownum) rowid from tjh_test) where rownum=1);
    select * from tjh_test where rowid=(select rowid from (select last_value(rowid) over(order by rownum
                                                                                        *
    ERROR 发生在第 1 行:
    ORA-00923: 未找到预期 FROM 关键字to l2g32003(leeshow)但是时间也只能精确到秒啊!!!要是同一秒插多条呢??