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
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 |
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 |
Answer / syam kumar
SELECT * FROM emp order by emp_date asc limit 10;
| Is This Answer Correct ? | 0 Yes | 0 No |
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 |
Answer / rajesh
select * from(select * from table_name order by date_column
desc) where rowid<=10
| Is This Answer Correct ? | 0 Yes | 2 No |
Answer / laxman
SELECT * FROM emp group by emp_date asc limit 10;
| Is This Answer Correct ? | 2 Yes | 6 No |
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 |
I would like to study certification course in Data base adminidtrator then where would i go to study this course?
1)After defining value set we define list of values, I need to enter 1000 values with out entering manually, how will you do that? 2)what are the parameters we use in a concurrent program? 3)what is payroll processing? 4)In organization window after defining an organization and organization classification how to create a new item in the others button? 5)If there are 10 users, How to restrict the selected users not to access the forms?
what are the API of GL,PO,AP
What is the difference between a TEMPORARY tablespace and a PERMANENT tablespace?
what are the tools used for oracle 10g in real time.
can u tell me how many types of oracle and which type all detail in oracle (suppose all history of oracle )
i am pursuing mca and i want to do oracle apps technical in hydrabad, plz guide me tne best institue in hydrabad those have excellent knowledge in oracle apps.
hi iam kavya, i completed Oracle11i(finance module), i do not know how to face the interview questions please adivese me
Whats the purpose of using Nextval while creating the sequence.
Explain the difference between a data block, an extent and a segment.
what is correlated subquery
Hey i want to join oracle apps so will you pls tell me that which institute is best in hyderabad.