-->
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: subqueries
PostPosted: Wed Jul 12, 2006 5:39 am 
Newbie

Joined: Wed Jul 12, 2006 5:33 am
Posts: 4
Hello!

I am doing following query:
Code:
SELECT a FROM Entity a WHERE DAY(CURRENT_DATE()-(SELECT MAX(b.myDate) FROM Entity2 b WHERE b.entity=a)) > 14

I got 'Unexpected AST node' exception. Query transformed into:
Code:
SELECT a FROM Entity a WHERE DAY(CURRENT_DATE())-DAY(SELECT MAX(b.myDate) FROM Entity2 b WHERE b.entity=a) > 14

is correct. What's the cause of this situation?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 12, 2006 8:16 am 
Newbie

Joined: Wed Jul 12, 2006 5:33 am
Posts: 4
CURRENT_TIMESTAMP solved the problem. Date type in db must match EQL function return type.


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.