请问如何得到没有回复的记录数? 两个表,主表table1回复表table2parentid:保存table1的id两表关系on id=parentid请问用一条sql怎么得到有多少条table1的记录还没有回复的记录数?就是table2里没有table1的id1 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select count(*) from table1 awhere not exists(select 1 from table2 where parentid=a.id); select count(*) from table1 awhere 0=(select count(*) from table2 where parentid=a.id); select count(*) from table1 awhere id not in(select distinct parentid from table2); PHP 不支持mysql call procedure的连续查询 PHP文本框的问题 新人报道 请教PHP上传文件后改文件名并保留文件后缀的问题 有 语音聊天室推荐几个吗??(急) PHP中用什么方法返回文件夹的大小啊? 我现在设置php.ini的设置对系统没有用? php下拉菜单问题 ThinkPhp ajax 提交 【真心求教!路过的大神们还请你们不吝赐教,多谢!】多人开发APP+后台,如何控制版本和需要购买服务器和数据库吗 菜鸟求助,高手请进,送分了 搞了很久都没成功,怎么样配置xp+apache+mysql+php
select count(*) from table1 a
where not exists(select 1 from table2 where parentid=a.id);
select count(*) from table1 a
where 0=(select count(*) from table2 where parentid=a.id);
select count(*) from table1 a
where id not in(select distinct parentid from table2);