title: sql union same parameters for two where = how to change it to one parameter
body: <p>I have this query </p>
  
  <pre><code>select last_name, job_id, department_name, country_name, hire_date
       , sysdate, salary
  from employees e
     , departments d
     , locations l
     , countries c 
  where e.department_id = d.department_id
    and d.location_id = l.location_id 
    and l.country_id = c.country_id 
    and upper(last_name) like upper('%&amp;name%')
  
  union 
  
  select last_name, j.job_id, department_name, country_name, start_date
       , end_date, to_number(null) 
  from employees e
    , job_history j
    , departments d
    , locations l
    , countries c 
  where j.department_id = d.department_id 
    and d.location_id = l.location_id 
    and l.country_id = c.country_id 
    and j.employee_id = e.employee_id 
    and upper(last_name) like upper('%&amp;name%');
  </code></pre>
  
  <p>as you see on both select in this union we get    'like upper('%&amp;name%')'
  is this is way to don't ask it both time but to pass it from first select to second in this union?</p>
  
  <p>Thank you for answers.</p>