• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with HQL : count(distinct of 2 columns)

 
Ranch Hand
Posts: 418
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic