Hi there.
I have a very strange resultset error. Im am executing a select statement agains my database. The result set should retrun 38 records and it does. No problem there. the problem is that the data returned isnt correct.
For example qhen the query is run against the table I should be retruned something like the following
ID | Country
1 US
1 UK
1 AU
2 UK
2 AU
2 BR
However Im retruned
ID | Country
1 US
1 US
1 US
2 UK
2 UK
2 UK
Has anyone come accross an error such as this. I hope this makes sense as its quite hard to put in to words.
Thanks Chris
3.1.3
<hibernate-mapping package="com.pctfiler.workflow.events">
<class name="Events"> <id name="ipAppId" type="string" /> <property name="country" type="string" /> </class>
<sql-query name="GetEvents" cacheable="true"> <return alias="event" class="Events"> <return-property name="ipAppId" column="IPAppId" /> <return-property name="country" column="country" /> </return> SELECT i.IPAppID, i.IPAppNumber, c.Country, i.CloseDate + INTERVAL Deadline MONTH AS CountryCloseDate, i.NumWordsClaims + i.NumWordsDesc AS TotalWords, tt.TransactionType, et.EventType FROM ip_applications i INNER JOIN opportunities t ON i.IPAppID = t.IPAppID INNER JOIN transaction_types tt ON t.OppType = tt.TransactionTypeID INNER JOIN opp_prod_countries tc ON t.OppID = tc.OppID INNER JOIN pct_countries pc ON tc.ProductID = pc.ProductID AND tc.CountryID = pc.CountryID INNER JOIN countries c ON pc.CountryID = c.CountryID INNER JOIN events e ON tc.ProductID = e.ProductID AND tc.CountryID = e.CountryID INNER JOIN event_types et ON e.EventTypeID = et.EventTypeID ORDER BY i.IpAppID </sql-query>
</hibernate-mapping>
My SQL 5.0
|