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

Explain an ORA-01555

2 Answers  


Explain the difference between a data block, an extent and a segment.

1 Answers   Accenture, IBM,


if i write the procedure.. and other person make the changes in that code then where i find who is changing my procedure

0 Answers  


can u give guidance abt packages of plsql

0 Answers   Mphasis,


What is the technical flow associated with P2P or Procure to Pay cycle like the tables, APIs, concurrent programs involved in this cycle. Only technical please.

0 Answers   TCS,


How would you determine the time zone under which a database was operating?

1 Answers  


what is shared memory?

1 Answers   IBM,


I have 3+ Years experience HR with Technical Recruitment Industry. Now i would like to learn oracle HRMS Models of all aspect. please suggest any one, which institution is best for oracle HRMS practical with real time teaching in Chennai, Tamilnadu. What are the basic stat up to learn Oracle HRMS with Core strongly?

1 Answers   Oracle,


hi iam kavya, i completed Oracle11i(finance module), i do not know how to face the interview questions please adivese me

0 Answers  


what are the advantages of Oracle over other databases..? please give me reply...

2 Answers  


Hi, IN oracle apps HRMS, if the employee changes his department, and when a conconurrent program is run for calulating the pay, The latest Dept id is not diaplayed, howeber the previous deptid is considered. Please can someone tell me where is the program going wrong, which side?

0 Answers  


Difference between negative and positive adjustments : oracle accounts receivable

0 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1808)
  • 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)