471,306 Members | 863 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,306 software developers and data experts.

Result set is forward array.but iwant reverse array

Result set contains the records of database in forward.But,i want to retrieve records in reverse order.
what should i do?
please someone help me to solve this problem.
Feb 17 '08 #1
6 1902
debasisdas
8,127 Expert 4TB
Oracle does not support this .
Feb 18 '08 #2
amitpatel66
2,367 Expert 2GB
Result set contains the records of database in forward.But,i want to retrieve records in reverse order.
what should i do?
please someone help me to solve this problem.
What is that result set (java prepared statement, or oracle cursor??) and could you please provide your query here for our expert's reference??

Can you also look at using ORDER BY DESC clause hat would reverse the data as required??
Feb 18 '08 #3
ResultSet rs=st.executeQuery("select name from table");

(suppose)the table is:

name rollno
abc 1a12
pqr 212




After executing the query the results are going to be stored in rs(ResultSet).

The results are going to be stored : (abc) as first record and (pqr) as second record.


But I want (pqr) as first record and (abc) as second record,then what should i do?


please reply to this...
Feb 19 '08 #4
amitpatel66
2,367 Expert 2GB
ResultSet rs=st.executeQuery("select name from table");

(suppose)the table is:

name rollno
abc 1a12
pqr 212




After executing the query the results are going to be stored in rs(ResultSet).

The results are going to be stored : (abc) as first record and (pqr) as second record.


But I want (pqr) as first record and (abc) as second record,then what should i do?


please reply to this...
Try something like :

Expand|Select|Wrap|Line Numbers
  1.  
  2. ResultSet rs=st.executeQuery("select name from table ORDER BY name DESC");
  3.  
  4.  
Feb 20 '08 #5
ResultSet rs=st.executeQuery("select name from table ORDER BY name DESC");



if we execute this query it will display the names in descending order i.e.,it will arrange the records in alphabetical order(z to a).

but, i want the record which is last in the table as first record in my resultset and the record which is first in the table as last .
Feb 25 '08 #6
debasisdas
8,127 Expert 4TB
Go to the last record and keep moving to the previous record till BOF .
Feb 26 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

9 posts views Thread by frizzle | last post: by
8 posts views Thread by Jim Langston | last post: by
5 posts views Thread by R. Rajesh Jeba Anbiah | last post: by
1 post views Thread by garimapuri | last post: by
2 posts views Thread by suma | last post: by
4 posts views Thread by John A Grandy | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.