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 / shekaran04
Hi,
First thing you cannot use " ROWNUM > (somthing) "
And to get last three records...
Select *from emp
minus
Select *from emp where rownum <(select Count(*) from emp)-
3;
Good Luck...
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
How do I run a sql query in pgadmin 4?
explain the difference between myisam static and myisam dynamic. : Sql dba
How to display Row Number with Records in Oracle SQL Plus?
What is sql analyzer?
What is snowflake sql?
Is it important to partition hard disk?
what is a field in a database ? : Sql dba
How to fetch alternate records from a table?
How do I partition a table in sql?
Can we create table inside stored procedure?
what are string data types? : Sql dba
Does sql use python?
how to write date and time literals? : Sql dba
What is the difference between joins?
what does it mean to have quoted_identifier on? : Sql dba