在SQL中如何删除b表中与a表不同的记录

2022-11-24 0 487



在SQL中如何删除b表中与a表不同的记录

 

  1. 删除b表中与a表不同的记录
  2. delete from b where not exists(select * from a where a.id=b.id and a.name=b.name)
  3. delete from b where b.id not in (select a.id from a) or b.name not in (select a.name from a)

delete from v9_photo_data where not exists(select * from v9_photo where v9_photo.id=v9_photo_data.id)
delete from v9_material_data where not exists(select * from v9_material where v9_material.id=v9_material_data.id)

 

1. 本站所有资源来源于用户上传和网络,因此不包含技术服务请大家谅解!如有侵权请邮件联系客服!cheeksyu@vip.qq.com
2. 本站不保证所提供下载的资源的准确性、安全性和完整性,资源仅供下载学习之用!如有链接无法下载、失效或广告,请联系客服处理!
3. 您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容资源!如用于商业或者非法用途,与本站无关,一切后果请用户自负!
4. 如果您也有好的资源或教程,您可以投稿发布,成功分享后有积分奖励和额外收入!
5.严禁将资源用于任何违法犯罪行为,不得违反国家法律,否则责任自负,一切法律责任与本站无关

源码下载

发表评论
暂无评论