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

oracle sql

From: jwa6 <jwagans_at_yahoo.com>
Date: 27 Jan 2005 13:42:32 -0800
Message-ID: <1106862151.993895.174470@c13g2000cwb.googlegroups.com>

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 Received on Thu Jan 27 2005 - 15:42:32 CST

Original text of this message

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