日期:2014-05-19  浏览次数:20493 次

一条语句的问题 散分了~
strsql   =   "delete   a,   b   from   cs_info   a   right   join   cs_ding   b   on   a.ctel=b.ctel   where   a.cname= ' "   &   Trim(Text1.Text)   &   " '   and   b.cdtime= ' "   &   DTPicker1.Value   &   " '


DELETE语句不能删除两个表的数据
那分开怎么写???????????????/

------解决方案--------------------
一次只能删除一个表

要不这样:
select a.主键 as a, b.主键 as b into # from cs_info a right join cs_ding b on a.ctel=b.ctel where a.cname= ' " & Trim(Text1.Text) & " ' and b.cdtime= ' " & DTPicker1.Value & " '


delete cs_info
from # a
where a.a=cs_info.主键

delete cs_ding
from # a
where a.b=cs_ding.主键