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

Home -> Community -> Usenet -> c.d.o.server -> Re: Sql Query Help -- Aggregating Rows

Re: Sql Query Help -- Aggregating Rows

From: <linux.hacker_at_gmail.com>
Date: Mon, 29 Oct 2007 07:16:37 -0700
Message-ID: <1193667397.333883.296030@o3g2000hsb.googlegroups.com>


I just wanted to thank everyone who helped me, I really learned a lot!

Just to follow up to help others, I needed the 2006 and 2007 rows to not include once from both years. Basically you take the 1 for 2006 and then you subtract out the "both" column. Since both can't be 1 unless 2006 is 1, then you know you'll never get a negative result.

MAX(DECODE(substr(Inventory.ISSUEDATE,8,4),2006,1,0))- MAX(DECODE(substr(Inventory.ISSUEDATE,8,4), 2007,1,0))*MAX(DECODE(substr(Inventory.ISSUEDATE,8,4),2006,1,0)) Received on Mon Oct 29 2007 - 09:16:37 CDT

Original text of this message

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