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 -> Re: oracle sql

Re: oracle sql

From: DA Morgan <damorgan_at_x.washington.edu>
Date: Fri, 28 Jan 2005 00:04:44 -0800
Message-ID: <1106899330.70737@yasure>


jwa6 wrote:

> hello
>
> I have an sql I need to write. I havent used sql for years.
> All the books are gone and Im finding age is taking its toll!
>
>
> THESE 2 WORK SEPERATELY
>
> SELECT
> EVENT_ID,
> EVENT_DATE
> FROM
> EVENT
> WHERE
> EVENT.EVENT_TYPE_CD = 'AR' AND
> TO_CHAR(TO_DATE(EVENT_DATE), 'YYYY' ) > '2004';
>
>
> select
> arrest_event_id,
> max(finding_DATE) -- can be many dates - I need the earliest
> FROM
> finding
> order by arrest_event_id ;
>
>
> I can join the tables event and finding as follows
> (1) EVENT.EVENT_ID = (many) FINDING.arrest_event_id
>
> I am having trouble putting them together.
>
> I need then this:
> all records between these 2 tables that are 2004 and 2005
> based on this...
> event.(EVENT_DATE), 'YYYY' ) > '2004' and
> the oldest finding_date(can be many finding records for 1 event record
> - I just need the first one)
> max( finding.finding_DATE)
>
>
>
> jim

Why is this question being asked again?

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Fri Jan 28 2005 - 02:04:44 CST

Original text of this message

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