我試圖通過使用獲得天月和年的s.eventTime
:休眠未知列
DAY(s.eventTime) as theDay, MONTH(s.eventTime) as theMonth, YEAR(s.eventTime) as theYear
再後來我用GROUP BY theYear, theMonth, theDay
這給我的錯誤:org.hibernate.exception.SQLGrammarException: Unknown column 'theYear' in 'group statement'
我有在SQL中使用過這種方法,並想知道它在HQL中是否無效?如果是這樣,有沒有人有建議?