-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: [HQL] concat
PostPosted: Fri Feb 10, 2006 3:42 am 
Newbie

Joined: Tue Nov 23, 2004 11:07 am
Posts: 7
Location: Switzerland
Hibernate version:2.1.8

Name and version of the database: Oracle 9.i

Hello
j'ai le problème suivant:
Je désire concaténer deux champs séparé par un espace vide dans une requête HQL:

Cette requête sans espace fonctionne:
Code:
select concat(m.ordergiver.userLastname , m.ordergiver.userFirstname), count(m) from MandatDTO as m group by m.ordergiver.userLastname , m.ordergiver.userFirstname where (m.dateMandat between :fromDate and :toDate) and (m.service = :service)


Si je mets un espace, ça foire !
Code:
select concat(m.ordergiver.userLastname ,' ' , m.ordergiver.userFirstname), count(m) from MandatDTO as m group by m.ordergiver.userLastname , m.ordergiver.userFirstname where (m.dateMandat between :fromDate and :toDate) and (m.service = :service)


Avez-vous une idée ?

Merci


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 10, 2006 4:08 am 
Newbie

Joined: Tue Nov 23, 2004 11:07 am
Posts: 7
Location: Switzerland
Yant la solution, la voici:
J'ai la solution. Il faut faire un concat dans le concat:

Code:
select concat(concat(m.ordergiver.userLastname,' '), m.ordergiver.userFirstname), count(m) from MandatDTO as m group by m.ordergiver.userLastname , m.ordergiver.userFirstname where (m.dateMandat between :fromDate and :toDate) and (m.service = :service)




Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.