File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Once again JAVA-ORACLE Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Reply 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: 14669
    
  11

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: 24039
    
  13

Moving to JDBC.


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

Joined: May 26, 2003
Posts: 26138
    
  66

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
More than one orderyby
how to use spaced column names in hibernate orderby mapping xml
How to retain order of list?
sorting problems in struts jsp
Improving EJB performance