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

unexpected token: group

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Could anybody answer me how to make this code run.

String sql = "select MONTH(CC.createddateTs) as months , "+

"(SELECT COUNT(CC1.communicationtypeTx) from Customercommunication as CC1 "+
" where CC1.communicationtypeTx = 'Complaint' and MONTH(CC1.createddateTs)= MONTH(CC.createddateTs) "+
" group by MONTH(CC1.createddateTs) ) as complaint," +

"(SELECT COUNT(CC2.communicationtypeTx) from Customercommunication as CC2 "+
" where CC2.communicationtypeTx = 'Enquiry' and MONTH(CC2.createddateTs)= MONTH(CC.createddateTs) "+
" group by MONTH(CC2.createddateTs) ) as Enquiry "+

"from Customercommunication as CC where YEAR((CC.createddateTs) = 2008 group by MONTH(CC.createddateTs) "+
"order by MONTH(CC.createddateTs) ASC";

Query query = mSession.createQuery(sql);

when i run this code i get this error:
ERROR [org.hibernate.hql.PARSER] - <line 1:698: unexpected token: group>
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please do not post the same question multiple times.

Let's continue the discussion in this duplicate thread, where you have answers already.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic