delete from `t_goods` where fi_id in (select * from ( select fi_id from `t_goods` where fs_num is null and fs_name is null and fs_type is null and
fs_using is null and fs_lifetime is null) b)
delete from `t_goods` where fi_id in (select fi_id from `t_goods` where fs_num is null and fs_name is null and fs_type is null and
fs_using is null and fs_lifetime is null)
delete from `t_goods` where fi_id in ( select fi_id from `t_goods` )
上面三种情况,只有中间的不能执行。
综合起来就是mysql delete from where in 时后面 的查询语句里不能加where条件
本文探讨了在 MySQL 中使用 DELETE FROM...WHERE IN 语句时的一些限制,特别是当子查询中包含 WHERE 条件时的问题。通过三个具体的 SQL 示例说明了不同情况下 IN 子句的行为差异。
63

被折叠的 条评论
为什么被折叠?



