EmployeeID Name EmployeeType
---------- ---- ------------
123456 ramesh Employee_full
3456 ramesh Contractor
234557 ramu Employee_full
2354 ramu Temp_emp
345678 rammy Employee_full
4568 rammy Contractor
以上是查询的输出,我希望将此输出作为子查询提供,以获得以下输出
EmployeeID Name EmployeeType
---------- ---- ------------
123456 ramesh Employee_full
3456 ramesh Contractor
345678 rammy Employee_full
4568 rammy Contractor
我需要删除名为ramu
的员工的记录。任何人都可以帮我吗?
答案 0 :(得分:4)
因为你没有说任何条件,所以很容易就这样做
SELECT * FROM your_table where Name <> 'ramu'
Name
employeetype
Temp_emp
SELECT * FROM table1 where Name not in
( select Name from table1 where EmployeeType = 'Temp_emp')
然后使用此
{{1}}