Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> SQL Statement Help

SQL Statement Help

From: Kobee <dbmdata_at_gmail.com>
Date: 6 Jul 2006 07:23:57 -0700
Message-ID: <1152195836.861895.243110@q16g2000cwq.googlegroups.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US