Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> SQL Statement Help
Hi,
I've been trying to get this SQL, but I just can't get it to work. It should a be a relatively simple SELECT on a single table, with 2 criteria - a date range for "lastupdate". Basically it's like "give me all the records from this table where the lastupdate is between startdate and enddate." There's one catch, though. There are three types of "transaction_types" in this table: "Add", "Update", "Delete". If the type is "Update", then there will be always be 2 records, with possibly different lastupdate values. The catch is that this SQL has to return the second "Update" row, even if it has a lastupdate outside of the specified date range. What's the best way to accomplish this?
Thanks in advance for any help. My SQL is not up to par... Received on Thu Jul 06 2006 - 09:23:57 CDT