Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> delete some records from table, keeping data consistency ?
Hi everybody,
I'd like to keep only the 100 last records from a table. Do y have an idea ??
SQL> SELECT COUNT(*) from emp ;
==> 150
SQL> DELETE FROM EMP WHERE ROWNUM < 101 ;
the pb here is :
- The clause ROWNUM may don't really select the 100 last records
- Data Consistency : If we delete table EMP, what about other data on to
tables with relation ship.
Do y have an idea ????? Received on Sun Aug 13 2000 - 00:00:00 CDT