Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> oracle sql
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
![]() |
![]() |