This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Problem with HQL : count(distinct of 2 columns)  RSS feed

 
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!