DISTINCT and ORDER BY [message #1062120] |
Thu, 06 June 2013 06:18 |
Oliver Baum Messages: 6 Registered: July 2009 |
Junior Member |
|
|
Hi,
I have a big problem with a NamedQuery. It dosn't work correct - maybe it's a bug in eclipselink.
NamedQuery:
(name = "findVertraege", query = "SELECT distinct v from VertragsSucheV v where v.partnerNr = :partnerNr order by v.pk.vertragNr, v.pk.vuCode")
Generated SQL:
SELECT DISTINCT ADRESSE, BUENDEL, GESELLSCHAFT, INVESTMENT, AMTLICHES_KENNZEICHEN, MAHNUNG, PARTNER_NR, POLICE_NR, PRODUKT, SPARTE, VERTRAGSZUSTAND, TARIF, TARIF_VIP, VERMITTLERNUMMER, VERSICHERTE_PERSON, VERTRAG_ID, VERTRAGSABLAUF, VERTRAGSROLLE_KBZ, ZUSATZVERSICHERUNG, VERTRAG_NR, VU_CODE, LFD_ROLLE_NR, VERTRAG_NR, VU_CODE FROM V_VERTRAGSUCHE WHERE (PARTNER_NR = ?) ORDER BY VERTRAG_NR ASC, VU_CODE ASC
bind => [12345678]
Exception:
ORA-00960: In der SELECT-Liste ist eine nicht eindeutige Spalte
How you can see, the Order By arguments are twice in the select statement.
If I use the NamedQuery without DISTINCT or without ORDER BY it works correct.
Can somebody please help me?
Thanks
Oliver
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03506 seconds