-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: [newbie] Subquery order by
PostPosted: Wed Apr 28, 2010 1:12 pm 
Newbie

Joined: Wed Apr 28, 2010 12:57 pm
Posts: 1
Hello,

I am trying to implement a SQL Query like this
Code:
select * from (select * from table order by column) where rownum <= 10;

using Hibernate.

I tried in various ways using simple HQL from statements like
Code:
String SQL_QUERY =" from ( from table as t order by column) where rownum <=10";

->>>org.hibernate.hql.ast.QuerySyntaxException: unexpected token: (
Code:
String SQL_QUERY =" from tableas t where exists ( from tableas z order by colum) and rownum < 10";

->>>java.sql.SQLException: ORA-00907: missing right parenthesis

Does anybody know a solution for this problem?

Bye
qwerter


Top
 Profile  
 
 Post subject: Re: [newbie] Subquery order by
PostPosted: Thu Apr 29, 2010 9:39 am 
Newbie

Joined: Wed Mar 03, 2010 3:36 am
Posts: 5
As per my knowledge,you can use order by in main query ,not possible
to use in subquery.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.