Question : Joining resutls of 2 queries together - Oracle

I need to join the results of the 2 queries below into one query - I have experimented with outer joins but have had trouble getting the results I need.  The first query returns the work assignment for an employee on a given date.  The second query has related information about the shift on the same date.  The second query may not always return results.  The only link between the 2 queries is emp_is and date.  

The specific emp_id's are included for testing, but they will be removed eventually.

The database is Oracle 10g, and this will be written in an Oracle stored proc/package.

Any suggestions?

Notes:
In the second query, the date in the shift_req table needs to be joined to the first query;  And, the emp_id in sched_shift needs to also be joined to the first query
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
Query #1:

SELECT EMP_LASTNAME,       
       WORK_DATE,
       ASSIGNMENT,
       SD.EMP_ID

  FROM EMPLOYEE  E,
       TIME_CODE T,
       
       EMPLOYEE_SCHED_DTL SD
       LEFT OUTER JOIN VUMC_ASSIGNMENT ASN ON (ASN_DATE =  ESCHD_WORK_DATE OR
ASN.Eschd_Id = SD.Eschd_Id)
AND SD.EMP_ID = ASN.EMP_ID
AND ASN.ASN_VAL1 = 'VALID'

 WHERE

 ESCHD_WORK_DATE = '4-Jul-2010' AND
 e.emp_id = 16472
 AND E.EMP_ID = SD.EMP_ID
 AND T.TCODE_ID = SD.TCODE_ID


Query #2:

select ss.* from 
sched_shift ss, shift_req sr, sched_process pr
where 
ss.rtssrq_id = sr.rtssrq_id and
pr.rtssp_id = sr.rtssp_id and
pr.rtssp_flag1 is not null
and sr.rtssrq_date_req = '4-Jul-2010'  --

Answer : Joining resutls of 2 queries together - Oracle

Are all the Exchange Services Started?
Random Solutions  
 
programming4us programming4us