两表之间的删除问题

SharnWong 2009-02-03 03:44:07
select * from A,B where A.id=B.id and B.code=112101
如果要删除怎么些呢
delete from A,B where A.id=B.id and B.code=112101不对- -!
请高手赐教
...全文
76 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
cnkiminzhuhu 2009-02-03
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 wufeng4552 的回复:]
SQL code--你要刪除A還是B?
delete A from A,B where A.id=B.id and B.code=112101
delete B from A,B where A.id=B.id and B.code=112101
[/Quote]
yangxuebao123 2009-02-03
  • 打赏
  • 举报
回复
delete from (select * from A,B where A.id=B.id and B.code=112101)
lihan6415151528 2009-02-03
  • 打赏
  • 举报
回复
如果要删除怎么些呢

看了半天才知道 是

如果要删除怎么写呢
bluefangxiao 2009-02-03
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 wufeng4552 的回复:]
SQL code--你要刪除A還是B?
delete A from A,B where A.id=B.id and B.code=112101
delete B from A,B where A.id=B.id and B.code=112101
[/Quote]
up
ccjjww1222 2009-02-03
  • 打赏
  • 举报
回复
可以用子查询做
lovelan1748 2009-02-03
  • 打赏
  • 举报
回复
能不能同时删掉呢
lgxyz 2009-02-03
  • 打赏
  • 举报
回复
你没指定要删除哪个表
SharnWong 2009-02-03
  • 打赏
  • 举报
回复
哈哈 太大意了 谢谢了
水族杰纶 2009-02-03
  • 打赏
  • 举报
回复
--你要刪除A還是B?
delete A from A,B where A.id=B.id and B.code=112101
delete B from A,B where A.id=B.id and B.code=112101

34,590

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧