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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: query help.

RE: query help.

From: Whittle Jerome Contr NCI <Jerome.Whittle_at_scott.af.mil>
Date: Thu, 22 Aug 2002 07:58:40 -0800
Message-ID: <F001.004BCD4A.20020822075840@fatcity.com>


I'd synchronize your computer with the atomic clock at the US Naval Academy. What if your sysdate is actually 2.3 seconds off?

Jerry Whittle
ACIFICS DBA
NCI Information Systems Inc.
jerome.whittle_at_scott.af.mil
618-622-4145

> -----Original Message-----
> From: cw [SMTP:cw_at_netlimit.com]
>
> Hey list Guru, Can anyone help me with this query? Many thanks,
>
> SELECT
> A.COUNTY_CODE,
> C.COUNTY_NAME,
> lpad(B.PRECINCT,4,' '),
> count(*),
> sum(DECODE(0,floor((months_between(sysdate,
> A.DOB)-(18*12))/(1*12)),1,0)),
> sum(DECODE(0,floor((months_between(sysdate,
> A.DOB)-(19*12))/(11*12)),1,0)),
> sum(DECODE(0,floor((months_between(sysdate,
> A.DOB)-(30*12))/(10*12)),1,0)),
> sum(DECODE(0,floor((months_between(sysdate,
> A.DOB)-(40*12))/(10*12)),1,0)),
> sum(DECODE(0,floor((months_between(sysdate,
> A.DOB)-(50*12))/(10*12)),1,0)),
> sum(DECODE(0,floor((months_between(sysdate,
> A.DOB)-(60*12))/(5*12)),1,0)),
> sum(DECODE(0,floor((months_between(sysdate,
> A.DOB)-(65*12))/(10*99)),1,0)),
> sum(decode(A.DOB, NULL, 1, 0))
> FROM ONLINE_VOTERS A, ADDRESS_INDEX B, COUNTIES C
> WHERE A.COUNTY_CODE = B.COUNTY_CODE
> AND A.ADDRESS_ID = B.ADDRESS_ID
> AND A.COUNTY_CODE = C.COUNTY_CODE
> AND A.STATUS IN ('V','S')
> GROUP BY A.COUNTY_CODE, C.COUNTY_NAME, lpad(B.PRECINCT,4,' ')
> UNION ALL
> SELECT
> D.COUNTY_CODE,
> C2.COUNTY_NAME,
> lpad(D.PRECINCT,4,' '),
> count(*),
> sum(DECODE(0,floor((months_between(sysdate,
> D.DOB)-(18*12))/(1*12)),1,0)),
> sum(DECODE(0,floor((months_between(sysdate,
> D.DOB)-(19*12))/(11*12)),1,0)),
> sum(DECODE(0,floor((months_between(sysdate,
> D.DOB)-(30*12))/(10*12)),1,0)),
> sum(DECODE(0,floor((months_between(sysdate,
> D.DOB)-(40*12))/(10*12)),1,0)),
> sum(DECODE(0,floor((months_between(sysdate,
> D.DOB)-(50*12))/(10*12)),1,0)),
> sum(DECODE(0,floor((months_between(sysdate,
> D.DOB)-(60*12))/(5*12)),1,0)),
> sum(DECODE(0,floor((months_between(sysdate,
> D.DOB)-(65*12))/(10*99)),1,0)),
> sum(decode(D.DOB, NULL, 1, 0))
> FROM OFFLINE_VOTERS D, COUNTIES C2
> WHERE D.COUNTY_CODE = C2.COUNTY_CODE
> AND D.STATUS IN ('V','S')
> GROUP BY D.COUNTY_CODE, C2.COUNTY_NAME, lpad(D.PRECINCT,4,' ');

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Whittle Jerome Contr NCI
  INET: Jerome.Whittle_at_scott.af.mil

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Thu Aug 22 2002 - 10:58:40 CDT

Original text of this message

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