Greetings,
Warning, I don't claim to be a SQL expert.
I have a table that uses Date as a timestamp, keeping nanosecond precision. I have a need to do a manual select query to count the number of rows by day and group them.
I am trying to execute the following query:
Code:
select count(*), convert(Date,hit.hitDatetime) from Hit hit group by convert(Date,hit.hitDatetime) order by convert(Date,hit.hitDatetime)
I am getting the following error:
Code:
org.springframework.dao.InvalidDataAccessApiUsageException: No data type for node: org.hibernate.hql.ast.tree.MethodNode
\-[METHOD_CALL] MethodNode: '('
+-[METHOD_NAME] IdentNode: 'convert' {originalText=convert}
\-[EXPR_LIST] SqlNode: 'exprList'
+-[IDENT] IdentNode: 'Date' {originalText=Date}
\-[DOT] DotNode: 'hit0_.hit_datetime' {propertyName=hitDatetime,dereferenceType=4,propertyPath=hitDatetime,path=hit.hitDatetime,tableAlias=hit0_,className=com.xxx.redirect.model.Hit,classAlias=hit}
+-[ALIAS_REF] IdentNode: 'hit0_.hit_id' {alias=hit, className=com.xxx.redirect.model.Hit, tableAlias=hit0_}
\-[IDENT] IdentNode: 'hitDatetime' {originalText=hitDatetime}
Any assistance would be greatly appreciated. Thank you in advance.