我有下面的专栏
----------------------------
brandb model class
nokia x2 2nd
nokia lumina 1st
sony xperia 1st
sony xperial 2nd
sumsun deo1 1st
sumsun deo2 1st
------------------------------------------------------------------------o/p
sunsun deo1 1st
sumsun deo2 1st如果诺基亚品牌和索尼公司包含甲骨文SQL查询中的二等产品,我想将其全部删除。
事先非常感谢
发布于 2014-04-27 03:44:43
如果确实希望从表中删除行,则可以尝试:
delete from table
where brandb in (select t2.brandb from table t2 where t2.class = '2nd');如果您只想返回一个没有这些模型的查询:
select t.*
from table t
where t.brandb not in (select t2.brandb from table t2 where t2.class = '2nd');发布于 2014-04-27 03:44:38
试试这个:
delete from mytable
where brandb in (
select brandb from myable
where class ='2nd')https://stackoverflow.com/questions/23319125
复制相似问题