Hello
i need your help with a native SQL query. Because of a project migration, complex queries and less time I have to use native SQLand the createSQLQuery function. The problem is selecting same table.
So the following is a short excerpt of the query:
Code:
SELECT
AGD.DATUM,
EGD.DATUM,
AGD.GENERATED_ID,
EGD.GENERATED_ID
FROM
C_BUCHG01 AGD,
C_BUCHG01 EGD
WHERE
AGD.B_ART = 'AGD'
AND
AGD.CO_Nr = EGD.CO_Nr
AND
AGD.U_Nr = EGD.U_Nr
If I try this with Oracle SQL Developer, it works fine, but with Hibernate I get strange results:
Oracle, something like:
Datum_1 Datum_2 ID_1 ID_2
12.10.07 14.10.08 5 6
NHibernate:
Datum_1 Datum_2 ID_1 ID_2
12.10.07 12.10.07 5 5
Hibernate always takes the data from the first table.
Hope you can help me