-->
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.  [ 1 post ] 
Author Message
 Post subject: Boolean expression in Order by clause
PostPosted: Thu Apr 13, 2006 10:16 am 
Newbie

Joined: Thu Apr 13, 2006 10:06 am
Posts: 1
I want to use a binary expression in the order by clause of my hql. I can do what I want in mySql using it's own sql syntax but I could't find any way of achieving the same result in hql.

The sql that I run on mySql server is as follows:

Code:
select .... order by ((`status` = '1' or `status` = '2') and starred = 'Y'), sendtime desc;


The messages that are evaluating the binary expression true are returned before all other message rows in mysql.

I write something like
Code:
order by ((m.status = '1' or m.status = '2') and m.starred = 'Y'), m.sendtime desc
in my hql but It gives a syntax error.

Is there any way to do something similar in hql?


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

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.