I have an query I run against an Oracle Connection.
I have these objects, an event table and a table to map my objects to my events.
My select statement selects the most recent event for each object and if it meets certain requirements then the object's id is returned.
something like
-
select o.id from
-
objects o, events e, objecteventmap oem,
-
(select max(date), o.id from events e, objects o, objecteventmap oem
-
where e.id = oem.eventid and o.id = oem.objectid) ss
-
where
-
o.id = oem.objectid and
-
e.id = oem.eventid and
-
o.id = ss.id and
-
e.date = ss.date and
-
<more where clause stuff>
-
The problem is when I run the query in Oracle SQL Developer I get 42 rows (the correct result set) and when I create an OracleCommand object and put that in as my query in my C# I get 30 rows (a reduced result set).
Help!
Edit:
Ok so I broke apart my query to get a better look at the data. In .net for some reason my Max date is getting the wrong date for some events. I am getting the ides of march instead of the correct date for a bunch of them. The weird thing is I do not have March 15th entered in my data anywhere....