select insured_record.insured_id,
employment_history.emp_hist_sequence,
employment_history.bank_id,
insured_plan.plan_code,
insured_plan.plan_code_seq,
ir_first_name,
ir_middle_initial,
ir_last_name,
ir_current_age,
eh_date_hired,
eh_life_class,
eh_weekly_salary,
eh_monthly_salary,
eh_annual_salary,
ip_covg_calc_code,
ip_premium_calc_code_1,
ip_premium_calc_code_2,
iph_covg_volume,
iph_premium
frominsured_record inner join
(employment_history inner join
(insured_plan inner join
insured_plan_history
on (insured_plan.insured_id = insured_plan_history.insured_id)
and (insured_plan.emp_hist_sequence =
insured_plan_history.emp_hist_sequence)
and (insured_plan.bank_id = insured_plan_history.bank_id)
and (insured_plan.plan_code = insured_plan_history.plan_code)
and (insured_plan.plan_code_seq =
insured_plan_history.plan_code_seq))
on (employment_history.insured_id = insured_plan.insured_id)
and (employment_history.emp_hist_sequence =
insured_plan.emp_hist_sequence)
and (employment_history.bank_id = insured_plan.bank_id))
on (insured_record.insured_id = employment_history.insured_id)
where (insured_plan.bank_id = 999999999)
and (employment_history.bank_id = 999999999)
and (iph_superceded_date is null)
and (ip_plan_status <> 't')
and ((eh_status = 't' and eh_date_terminated > '10/15/2000')
or (eh_status <> 't'))
order by insured_record.insured_id,
insured_plan.plan_code,
insured_plan.plan_code_seq
Get your codes from..
Saturday, May 10, 2008
Nested Inner Joins with high Complexity
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment