Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with HQL : count(distinct of 2 columns)

 
Raj Kumar Bindal
Ranch Hand
Posts: 418
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am not able to get count of distinct of 2 columns using hql.
This is the query:
select count ( distinct emp.id ||','|| emp.name ) from com.Employee emp

This exception is coming when i am execuing it:

2013-05-21T13:51:19.829+0530 ERROR line 1:33: expecting CLOSE, found '||'
2013-05-21T13:51:19.834+0530 DEBUG line 1:33: expecting CLOSE, found '||'
line 1:33: expecting CLOSE, found '||'
at antlr.Parser.match(Parser.java:211)
at org.hibernate.hql.antlr.HqlBaseParser.aggregate(HqlBaseParser.java:4401)
at org.hibernate.hql.antlr.HqlBaseParser.identPrimary(HqlBaseParser.java:4052)
at org.hibernate.hql.antlr.HqlBaseParser.primaryExpression(HqlBaseParser.java:861)
at org.hibernate.hql.antlr.HqlBaseParser.atom(HqlBaseParser.java:3438)
at org.hibernate.hql.antlr.HqlBaseParser.unaryExpression(HqlBaseParser.java:3216)
at org.hibernate.hql.antlr.HqlBaseParser.multiplyExpression(HqlBaseParser.java:3098)
at org.hibernate.hql.antlr.HqlBaseParser.additiveExpression(HqlBaseParser.java:2818)


Can somebody please tell the solution for this.
 
Raj Kumar Bindal
Ranch Hand
Posts: 418
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone suggest any solution for this problem please.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic