急送分 我现在有A,B,C 三张表 A:A_ID ,a_int01; B:B_id,re_id C: c_id,c_img01 其中c表是b表的附属表b_ID=c_id 对应 ,B 表的re_id=a_id 对应 那我现在想统计出 c表中c_img01的个数放在A表的a_int01 中 具体 怎么写 谢谢啊 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 --试下insert into a(a_int01) select c_img01 from (select c_id,count(1) as c_img01 from b group by c_id)t delete from Ainsert into ASelect B.Re_ID,COUNT(distinct c_img01) numfrom B inner join C on B.b_ID=C.c_id update Aset a_iint01 = (select count(1) from b,c where c_id = b_id and a.a_id = re_id) 少了group by re_IDdelete from Ainsert into ASelect B.Re_ID,COUNT(distinct c_img01) numfrom B inner join C on B.b_ID=C.c_id Group by B.Re_ID insert into Aselect B.re_id,count(*)from B,C where B.b_ID=C.c_idgroup by B.re_id update a seta_int01=(select count(1) from b,c where b_ID=c_id and re_id=a_id ) 求教 如何把列转换成行 请问有关时间的SQL语句如何写? 一个关于FOXPRO和SQLSERVER数据库表相互导入的问题 各位帮忙看下这个sql语句的问题 不能安装SQLserver2005,出现了这个提示是什么原因?? 删除问题? 针对微软SQL Server的无名蠕虫正在传播 如何在proc中调用存储过程 碰到一个怪问题,表值函数查询几十秒才能查询完成,直接执行SQL语句只要9秒。为啥会这样? 探讨[存储过程 批量删除记录] 急 急 急!
insert into a(a_int01) select c_img01 from (select c_id,count(1) as c_img01 from b group by c_id)t
insert into A
Select B.Re_ID,COUNT(distinct c_img01) num
from B inner join C on B.b_ID=C.c_id
set a_iint01 = (select count(1) from b,c where c_id = b_id and a.a_id = re_id)
delete from A
insert into A
Select B.Re_ID,COUNT(distinct c_img01) num
from B inner join C on B.b_ID=C.c_id
Group by B.Re_ID
select B.re_id,count(*)
from B,C where B.b_ID=C.c_id
group by B.re_id
a_int01=(select count(1) from b,c where b_ID=c_id and re_id=a_id )