hql关于join查询的问题
hql语句:
from MipUserOnlineStatistic a join (select statisticstime,max(onlinecnt) cnt from MipUserOnlineStatistic where enterpriseid ? and statisticstime like ? group by statisticstime) as b on a.statisticstime=b.statisticstime and a.onlinecnt = b.cnt group by a.statisticstime
报错:
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from MipUserOnlineStatistic a join( select statisticstime,max(onlinecnt) cnt from' at line 1
这个程序的问题是解决了,但是还是希望知道是什么原因,导致这个hql语句不能用,我觉得语法可没有什么问题呀,在db上运行是可以的,就是在hql上一直报错,不知道为什么,请大家帮忙看下,十分感谢。!!!!