列出employees
的薪水与“ ram”或“ sham”的薪水相同。
以下是表格的详细信息:
emp_id, emp_name, job_name, salary
这是我的查询:
select *
from employees
where salary = (select salary
from employees
where emp_name ='sham' or emp_name = 'ram');
答案 0 :(得分:3)
select *
from employees
where salary IN
(
select salary
from employees
where emp_name IN ('sham', 'ram')
);