如何根据A表的SELECT的结果来删除对应B表的记录 试一下:delete afrom db_b a,dba_b where a.a_id=b.b_id and b.fld_c='x' 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 delete from db_b join (select a_id from db_a where fld_c='x') b on db_b.b_id=b.a_id delete afrom db_b a,dba_b bwhere a.a_id=b.b_id and b.fld_c='x' delete from db_b where b_id in (select a_id from db_a where fld_c='x') delete from db_b where b_id in (select a_id from db_a where fld_c='x') delete a from db_b a join(select a_id from db_a where fld_c='x') b on a.b_id=b.a_id --或者:delete db_bfrom db_b b where exists( select 1 from(select a_id from db_a where fld_c='x')a where b.b_id=a.a_id) 上面的语句都是基于不改变与查询结果集关联这个慨念来做的.如果直接分析你的删除语句进行修改,就可以用:delete db_bfrom db_b b join db_a a join a.a_id=b.b_idwhere a.fld_c='x' delete a from db_b a join (select a_id from db_a where fld_c='x') b on a.b_id=b.a_id varchar nvarchar 很急求教:PD10中使用的反向工程直接无法获取已经存在的字段注释吗? sqlagent 里面的cmd作业提交报错 请教关于时间的查询细节 关于checksum 数据恢复问题 如何将纪录逆序取出 sql server与access的连接问题 sql脚本导入 远程数据库总是报错,求大神指教!! sql对数据统计 关于SQL函数应用问题 有关查询的问题!!
from db_b a,dba_b b
where a.a_id=b.b_id and b.fld_c='x'
delete a from db_b a join(select a_id from db_a where fld_c='x') b on a.b_id=b.a_id
from db_b b
where exists(
select 1 from(select a_id from db_a where fld_c='x')a
where b.b_id=a.a_id)
from db_b b join db_a a join a.a_id=b.b_id
where a.fld_c='x'