-->
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: using timestampdiff in hql
PostPosted: Tue May 18, 2010 11:48 pm 
Newbie

Joined: Tue May 18, 2010 11:40 pm
Posts: 1
Hi,

I am new to Hibernate. I have a quick question regarding the usage of timestampdiff in HQL. I am using mySQL as the database and the following executes fine on MySQL.

select timestampdiff(second,starttime, endtime) from requests where id = 234;

I couldn't get the equivalent HQL query. Does HQL provide equivalent function? I tried searching for it, but in vain.

Here is the HQL query I used, but it failed.

select timestampdiff(second, req.starttime, req.endtime ) as difftime from Request req where req.id = 234;

If anybody used it or know about it, please let me know.

Thanks,
Kumar


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.