问一句SQL语句,帮我看一下是不是写的对。 嗯~``应该是正确的吧~假如你的tid是int型的话~delete from cdb_threads where tid not in (select tid from cdb_posts) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 delete from cdb_threads as a where not exists(select * from cdb_posts as b where a.tid=b.tid) 看看这个可行? 有可能cdb_post表中的数据scdb_threads表中都有,不符合where 子句的条件,所以就不对那一行进行操作(删除)喽! 表cdb_posts中不存在一条记录对应cdb_threads表ATID字段的数据就应该把cdb_threads表ATID字段对应表cdb_posts的数据全删除应该是in而不是not in吧delete from cdb_threads where cdb_threads.atid in (select cdb_posts.atid from cdb_posts) 感觉题目好模糊呀.. 数据库的设计 php如何实现类似ecshop中的产品对比功能 对象元素名中含变量怎么办? 数据库取出的值怎么用逗号分隔成可读性强的数据? php使用持续连接,Apache停止服务的时候会出现错误提示 如何使从mysql中查找的字串不区分大小写? 那一位有邮件系统的源代码(1000分送) Apache2.0.35 PHP4.20標版模塊編譯釋出!徵集測試!!! 问一下,谁有计算某日所属的当周内的其他日期的函数 求助帖 PHP接收不到POST传入的数据 当变量非常多时,请教解决方法! 找个正确的原创帖子都难
where not exists(select * from cdb_posts as b where a.tid=b.tid)
看看这个可行?
就应该把cdb_threads表ATID字段对应表cdb_posts的数据全删除应该是in而不是not in吧
delete from cdb_threads where cdb_threads.atid in (select cdb_posts.atid from cdb_posts)
感觉题目好模糊呀..