|
-
You need or a column with a timestamp, date column filled with sysdate as record is inserted:
SELECT e1.*
FROM emp e1
WHERE 2 > (
SELECT COUNT(*)
FROM emp e2
WHERE e2.timestamp > e1.timestamp);
Or a column based on a sequence, e.g. empno:
SELECT e1.*
FROM emp e1
WHERE 2 > (
SELECT COUNT(*)
FROM emp e2
WHERE e2.empno > e1.empno);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|