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 / alok narayan

Rownum assigned at the runtime on the basis of rownum you
not fetch last three records.

for no records output: Rownum always use <= or >= , if use
rownum < or > its giving no output.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many types of cursors supported in pl/sql?

590


How delete a row in sql?

533


What is scalar data type in pl sql?

549


What is difference between function and trigger?

546


what is table? : Sql dba

570






what is the maximum length of a table name, database name, and fieldname in mysql? : Sql dba

617


Can we use ddl statements in stored procedure?

696


Which table is left in left join?

521


What is dbo in sql?

533


how to drop an existing table in mysql? : Sql dba

554


How does index help in query performance?

562


How can we link a sql database to an existing android app?

546


in oracle 10g sw after compiling procedure how to pass parameter values ,if we (v_empid out number)how to give empid after successful compilation program.This site exact suitable for 10g with respect to question & answer same format , im trying sql browser & sql command prompt using exec procedure name & respective parameters.

1643


Is progress software supports to ( pl/sql )?

526


What is structural independence and why is it important?

546