b1nary0mega
10/10/2014 - 5:47 PM

select unit ids and 'hard coded' data into a query result set that can be pasted into sql developer for units that are lacking the specific

select unit ids and 'hard coded' data into a query result set that can be pasted into sql developer for units that are lacking the specific time code.

SELECT DISTINCT unit_id, 
'ABSENT' as Np_Time_Code,
'0' as ASSOC_HOURS,
'T' as CATEGORY,
'Absent' as DESCRIPTION
FROM unit_spec
WHERE Facility_Id = 'HH'
AND Active        = 'Y'
AND unit_id NOT  IN
  ( SELECT DISTINCT unit_id FROM unit_np_time WHERE Np_Time_Code = 'ABSENT'
  );