Requête HQL avec clause distinct et count
Bonjour je suis sous Hibernate 3 et oracle 10g et j'ai la requête HQL suivante :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
SELECT count(distinct cert.numSerieCertif,cert.numSerieCertif)
FROM Certificat as cert
WHERE cert.numeroCarte IS NOT NULL
AND cert.dateDebutValid <= to_date(:synchroTime,'DD/MM/YYYY HH24:MI:SS')
AND cert.dateFinValid > to_date(:synchroTime,'DD/MM/YYYY HH24:MI:SS')
AND cert.datePublication IS NULL
AND cert.dateRevocation IS NULL
AND cert.typeIdentifiant IN (0, 2, 8, 9)
AND exists(SELECT caP.numeroLogiqueCarte
FROM CartePhysique as caP
WHERE caP.carteAnonyme = '0'
AND caP.numeroLogiqueCarte = cert.numeroCarte) |
Or le problème est qu'il me sort l'erreur suivante :
Code:
1 2 3 4
|
line 3:67: expecting CLOSE, found ','
Error in named query: count.add.select.lots.certificat.ps
org.hibernate.hql.ast.QuerySyntaxException: expecting CLOSE, found ',' near line 3, column 67 |
Auriez-vous une idée de comment résoudre cela ???
J'ai essayé aussi de faire SELECT count(distinct cert.numSerieCertif || cert.numSerieCertif) ... mais ça ne marche pas mieux !