A Table has 10,000 records,How can i get latest 10 dates
from the table.so that i can only store those 10 records
in to my Resultset Object,to reduce load on my app?

Answers were Sorted based on User's Feedback



A Table has 10,000 records,How can i get latest 10 dates from the table.so that i can only store ..

Answer / ravikumar.s

select * from (select * from tblname order by datecolumn
asc) where rownum<=10;

There is no keyword in oracle like limit, only we can fetch
through rownum

in mysql only this limit is available
ex: select col from tbl limit 20;

in sql server we use Top keyword instead of limit;

Is This Answer Correct ?    10 Yes 1 No

A Table has 10,000 records,How can i get latest 10 dates from the table.so that i can only store ..

Answer / sonu

Answer of Ravikumar.s is almost write but there is slightly
mistake, he should write 'desc' keyword instead of 'asc'
because question for latest records not for the oldest
records. So, the correct answer is

select * from (select * from tablename order by datecolumn
desc) where rownum<=10;


One keyword makes the statement and result write or wrong
so, use these carefully.

Is This Answer Correct ?    7 Yes 0 No

A Table has 10,000 records,How can i get latest 10 dates from the table.so that i can only store ..

Answer / syam kumar

SELECT * FROM emp order by emp_date asc limit 10;

Is This Answer Correct ?    0 Yes 0 No

A Table has 10,000 records,How can i get latest 10 dates from the table.so that i can only store ..

Answer / laxman

select payment_id,payment_date from care_billing_payment
order by payment_id desc limit 10;
this query give latest 10 rows;

Is This Answer Correct ?    6 Yes 7 No

A Table has 10,000 records,How can i get latest 10 dates from the table.so that i can only store ..

Answer / rajesh

select * from(select * from table_name order by date_column
desc) where rowid<=10

Is This Answer Correct ?    0 Yes 2 No

A Table has 10,000 records,How can i get latest 10 dates from the table.so that i can only store ..

Answer / laxman

SELECT * FROM emp group by emp_date asc limit 10;

Is This Answer Correct ?    2 Yes 6 No

A Table has 10,000 records,How can i get latest 10 dates from the table.so that i can only store ..

Answer / ranjan satapathy

Your query: to get latest 10 dates from the table

select date_column , *
from table
where date_column between sysdate and (sysdate-10)

will show the latest date upto 10 last day

Is This Answer Correct ?    2 Yes 8 No

Post New Answer

More Oracle AllOther Interview Questions

How do you create a credit note against an invoice? : oracle accounts receivable

0 Answers  


HOW TO SAVE UNIVERSES AND DOCUMENTS IN THE REPOSITORY?

0 Answers  


Can we get the deleted Record again if the delete transaction has been committed.

4 Answers  


Can anybody tell which is the best training institute for learning Oracle in chennai...? And i also i want placement assurance

1 Answers  


Differentiate between transaction type and transaction source? : oracle accounts receivable

0 Answers  






How client makes connection with server in client/server architecture?

1 Answers   CA,


What Are Cross Validation & Adi?

0 Answers   Oracle,


When creating a user, what permissions must you grant to allow them to connect to the database?

4 Answers  


how to create an user in oracle 10g.please give me an example..

1 Answers  


I am working in Oracle Clinical 4.5.1 Please explain a bit.How to create Views in OC

4 Answers   Icon,


What are different types of transactions in ar? : oracle accounts receivable

0 Answers  


Explain the difference between ARCHIVELOG mode and NOARCHIVELOG mode and the benefits and disadvantages to each.

1 Answers   HCL,


Categories
  • Oracle General Interview Questions Oracle General (1789)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)