How do you retrieve the last N records from a table?

Answer Posted / nani

select * from emp a where &N > (select count(*) from emp b
where b.rowid > a.rowid)

N = No.of rows.

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how would you get the current date in mysql? : Sql dba

532


What are sql queries used for?

526


What is difference between sql and oracle?

554


what is an execution plan? When would you use it? How would you view the execution plan? : Sql dba

539


how to increment dates by 1 in mysql? : Sql dba

539






How do I start sql from command line?

527


What is trigger types in sql?

529


What is sqlexception in java?

542


Can sql function call stored procedure?

552


How does postgresql compare to mysql?

571


What is %s in sql?

559


Is mariadb a nosql database?

532


What is sql performance tuning?

488


how to create a table index in mysql? : Sql dba

588


Define sql delete statement.

553