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:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
|
select a.emp_id, a.last_name, a.first_name, a.st_cd, a.country_cd, a.emp_stat_cd, a.stat_date, a.term_type_num, a.term_type_descr, a.birth_date, a.hire_date
, a.adjusted_hire_date, c.hiring_location_id, a.emp_title_num, a.emp_title_descr, a.pr_class_num, a.pr_class_descr, a.reg_rate, a.class_reg_rate, a.ou_id, a.SS_NUM, a.PAY_GROUP_NUM, a.PR_CLASS_NUM, a.PAY_RT_NUM, a.WH_ST_CD, a.UC_ST_CD
, a.VETERAN_STAT_CD, a.race_cd, a.EEO_CD_DESCR, a.ADDR_1, a.CITY, a.ST_CD, a.POSTAL_CD, a.PHONE_AREA_CD, a.PHONE_NUM, a.GENDER_DESCR
, ed.EMP_ID, ed.DED_NUM, ed.EFF_DATE, ed.EXPIR_DATE, ed.AMT, ed.PCT, ed.LIMIT_AMT
, d.DED_NUM, d.DESCR, d.CALC_BASE_NUM, d.FREQ_NUM, d.AMT, d.SHORT_dESCR
from
(
select a.emp_id, a.last_name, a.first_name, a.st_cd, a.country_cd, a.emp_stat_cd, a.stat_date, a.term_type_num, a.term_type_descr, a.birth_date, a.hire_date
, a.adjusted_hire_date, c.hiring_location_id, a.emp_title_num, a.emp_title_descr, a.pr_class_num, a.pr_class_descr, a.reg_rate, a.class_reg_rate, a.ou_id, a.SS_NUM, a.PAY_GROUP_NUM, a.PR_CLASS_NUM, a.PAY_RT_NUM, a.WH_ST_CD, a.UC_ST_CD
, a.VETERAN_STAT_CD, a.race_cd, a.EEO_CD_DESCR, a.ADDR_1, a.CITY, a.ST_CD, a.POSTAL_CD, a.PHONE_AREA_CD, a.PHONE_NUM, a.GENDER_DESCR
from emp_mstr_with_curr_hrly_rate a
inner join employee_udf C on a.emp_id = C.emp_id
where a.emp_stat_cd = 'A'
or a.emp_stat_cd = 'I'
and a.stat_date >= '1965/04/01'
and a.stat_date <= '2009/06/08'
and a.pr_class_num in ('1', '2', '4', '6')
group by a.emp_id, a.last_name, a.first_name, a.st_cd, a.country_cd, a.emp_stat_cd, a.stat_date, a.term_type_num, a.term_type_descr, a.birth_date, a.hire_date
, a.adjusted_hire_date, c.hiring_location_id, a.emp_title_num, a.emp_title_descr, a.pr_class_num, a.pr_class_descr, a.reg_rate, a.class_reg_rate, a.ou_id, a.SS_NUM, a.PAY_GROUP_NUM, a.PR_CLASS_NUM, a.PAY_RT_NUM, a.WH_ST_CD, a.UC_ST_CD
, a.VETERAN_STAT_CD, a.race_cd, a.EEO_CD_DESCR, a.ADDR_1, a.CITY, a.ST_CD, a.POSTAL_CD, a.PHONE_AREA_CD, a.PHONE_NUM, a.GENDER_DESCR
union
select b.emp_id, b.last_name, b.first_name, b.st_cd, b.country_cd, b.emp_stat_cd, b.stat_date, b.term_type_num, b.term_type_descr, b.birth_date, b.hire_date
, b.adjusted_hire_date, c.hiring_location_id, b.emp_title_num, b.emp_title_descr, b.pr_class_num, b.pr_class_descr, b.yearly_sal_amt, b.po_limit_amt, b.ou_id, b.SS_NUM, b.PAY_GROUP_NUM, b.PR_CLASS_NUM, b.PAY_RT_NUM, b.WH_STAT_CD, b.UC_ST_CD
, b.VETERAN_STAT_CD, b.race_cd, b.EEO_CD_DESCR, b.ADDR_1, b.CITY, b.ST_CD, b.POSTAL_CD, b.PHONE_AREA_CD, b.MARITAL_STAT_CD, b.GENDER_DESCR
from emp_mstr_with_curr_salary b
inner join employee_udf C on b.emp_id = C.emp_id
where b.emp_stat_cd = 'A'
or b.emp_stat_cd = 'I'
and b.stat_date >= '1965/04/01'
and b.stat_date <= '2009/06/08'
and b.pr_class_num in ('1', '2', '4', '6')
group by b.emp_id, b.last_name, b.first_name, b.st_cd, b.country_cd, b.emp_stat_cd, b.stat_date, b.term_type_num, b.term_type_descr, b.birth_date, b.hire_date
, b.adjusted_hire_date, c.hiring_location_id, b.emp_title_num, b.emp_title_descr, b.pr_class_num, b.pr_class_descr, b.yearly_sal_amt, b.po_limit_amt, b.ou_id, b.SS_NUM, b.PAY_GROUP_NUM, b.PR_CLASS_NUM, b.PAY_RT_NUM, b.WH_STAT_CD, b.UC_ST_CD
, b.VETERAN_STAT_CD, b.race_cd, b.EEO_CD_DESCR, b.ADDR_1, b.CITY, b.ST_CD, b.POSTAL_CD, b.PHONE_AREA_CD, b.MARITAL_STAT_CD, b.GENDER_DESCR
) a
left outer join emp_ded ed on a.emp_id = ed.emp_id
left outer join deduction d on ed.ded_num=d.ded_num
where ed.DED_NUM in (537, 561, 562, 546, 513, 573, 574, 512, 521, 529, 523, 520,527, 528, 530, 534)
and d.DED_NUM in (537, 561, 562, 546, 513, 573, 574, 512, 521, 529, 523, 520,527, 528, 530, 534)
order by a.last_name
|