Monday, June 8, 2009

last rowid Tabloya eklenen en son kaydı bulma

select * from where rowid=(select max(rowid) from )
SQL> create table test (salary number);
SQL> insert into test values(100);
SQL> commit;
SQL> insert into test values(102);
SQL> insert into test values(103);
SQL> select * from test where rowid=(select max(rowid) from test);
SALARY

103
SQL> insert into test values(104);
SQL> select * from test where rowid=(select max(rowid) from test);
SALARY

104

SQL> insert into test values(1010);
1 row created.
SQL> commit;
Commit complete.
SQL> select * from test where rowid=(select max(rowid) from test);
SALARY

1010
SQL> insert into test values(105);
1 row created.
SQL> commit;
Commit complete.
SQL> select * from test where rowid=(select max(rowid) from test);
SALARY

105

No comments: