wood burning stoves 2.0*
The moose likes JDBC and the fly likes Once again JAVA-ORACLE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Once again JAVA-ORACLE" Watch "Once again JAVA-ORACLE" New topic
Author

Once again JAVA-ORACLE

bala rajesh
Greenhorn

Joined: Jul 31, 2006
Posts: 6
I know about JDBC

I want a "query" to retrive the data from one oracle table,
the condition is one column orderby ascending order and another column orderby desc order.

Thanks in Advance

Bala
Pratibha Malhotra
Ranch Hand

Joined: Dec 21, 2003
Posts: 199
Hi Bala

If this is what you want

column A Column B
A Z
B Y
C X


Then I will say there is no ready-to-use solution.
You can however query these columns seperatly and club the result-sets together in java.


~ Pratibha Malhotra<br /> <br />Sun Certified Java Programmer<br />SCEA 1.4 (In Progress)<br />~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />"Many of life's failures are people who did not realize how close they were to success when they gave up!!"
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Don't know if this would work everywhere (I tried with Oracle 8i):
SELECT
columnA,
columnB
FROM
mytable
ORDER BY
columnA ASC,
columnB DESC


[My Blog]
All roads lead to JavaRanch
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Moving to JDBC.


[Jess in Action][AskingGoodQuestions]
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30138
    
150

Satou,
The query you provided uses standard SQL so it will work on all databases (with the possible exception of Access.)


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Once again JAVA-ORACLE
 
Similar Threads
how to use spaced column names in hibernate orderby mapping xml
Improving EJB performance
sorting problems in struts jsp
More than one orderyby
How to retain order of list?