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 / swastik
SELECT * FROM
(
SELECT * FROM Emp
ORDER BY ROWNUM DESC
)
WHERE ROWNUM <= 3;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How can use stored procedures in sql?
what does it mean to have quoted_identifier on? What are the implications of having it off? : Sql dba
Can we create table inside stored procedure?
Is id a reserved word in sql?
Explain the working of primary key?
What is normalization? How many normalization forms are there?
How do you bind variables in pl sql?
Cite the differences between execution of triggers and stored procedures?
What is a file delimiter?
Why do we need cursor in pl sql?
What are the three pl sql block types?
what is 'mysqlshow'? : Sql dba
Why procedure is used in sql?
What is sql in oracle?
i have 2 table table one 4 columns respective values a1 7,a2 6,a3 8 ,a4 12 & table two 4 colums respective values a1 7,a2 6,a3 8,a4 15.if table one & table two 3 colums same then 4th column values 1)Qes diff >5 then print 5 * diff value 2)Que diff <5 print 5