how to retrieve last tree records from table?
select *from emp where rownum > (select count(*)-3 from
emp);
i am using this query to get last three records from table
but its not giving any output, so please tell me what is the
error in this query.
Answer Posted / sanjay
SELECT ROWNUM AS rank, employee_id
FROM (SELECT employee_id
FROM employees
ORDER BY employee_id DESC)
WHERE ROWNUM<=3
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What is AUTH_ID and AUTH_USER in pl/sql ?
What does dml mean?
Which are the different character-manipulation functions in sql?
How to change the order of columns in Oracle SQL Plus ?
How do I add a primary key to a table?
ERROR:Insert or update on table"accnt" violates foreign key constraints "acct_to_curr_symbol" DETAILS:KEY(accnt_curr_id)(-2)is not present in the table "curr_symbol" ......solve The Problem..
how would concatenate strings in mysql? : Sql dba
What is out parameter used for eventhough return statement can also be used in pl/sql?
How do I find duplicates in sql?
How to install oracle sql developer?
How to add new employee details in an employee_details table with the following details
Can a table contain multiple foreign key’s?
How do I kill a query in postgresql?
What is multiple columns?
What is column?