我有这个查询
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('%&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('%&name%');
正如您在此联合中的两个选择中看到的那样,我们得到 'like upper('%&name%')' 这是不是两次都询问它,而是将它从第一个选择传递到该联合中的第二个?
谢谢你的回答。