Win a copy of Python Continuous Integration and Delivery this week in the Python 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:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!