-->
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: mysql 3.23 and having
PostPosted: Mon Nov 15, 2004 6:14 am 
Newbie

Joined: Mon Nov 15, 2004 5:39 am
Posts: 1
i have trouble when using having clause at mysql 3.23...
hibernate translate hql into sql and adding aliases for all fields in query. in having clause hibernate uses filed names instead aliases.
but mysql 3.23 not work when access field with alias. in sql:
this not works
select traffic0_.SrcIp as x0_0_, sum(traffic0_.DataAll) as x1_0_ from traffic traffic0_ group by traffic0_.SrcIp having (traffic0_.SrcIp like '217.71.138.%' )
this works:
select traffic0_.SrcIp, sum(traffic0_.DataAll) as x1_0_ from traffic traffic0_ group by traffic0_.SrcIp having (traffic0_.SrcIp like '217.71.138.%' )
and this works too:
select traffic0_.SrcIp as x0_0_, sum(traffic0_.DataAll) as x1_0_ from traffic traffic0_ group by traffic0_.SrcIp having (traffic0_.x0_0_ like '217.71.138.%' )

any ideas how to fix it?

Hibernate version: 2.1.41

Full stack trace of any exception that occurs:

Name and version of the database you are using: mySql 3.23

The generated SQL (show_sql=true): select traffic0_.SrcIp as x0_0_, sum(traffic0_.DataAll) as x1_0_ from traffic traffic0_ group by traffic0_.SrcIp having (traffic0_.SrcIp like '217.71.138.%' )


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.