如何delete用select选中的数据

来源:百度知道 编辑:UC知道 时间:2024/05/07 04:12:07
delete from select * from table
这样写无法执行,请问怎样改写.

不明白楼主要删除什么。要是一个表delete from table where 就行啦。如果不是那就关联一下嘛delete from table1 where tabel1.xx in
(select xx from table2 where ),如果两个表没有关系,delete from table where exists(select 1 From table2 where )

语法:
DELETE FROM TABLE——NAME(表名)
WHERE SEARCH——CONDITION(条件)
注意 delete 只能整行整行的删除 不能删除单个字段
如果没有where 字句 那代表你将表中的所有数据全删除

delete from 可直接加入表及其过滤条件即
delete from table where 条件,
用select * from table 为多余。

delete from table where 条件;

delete from 表名 where 条件 即可,