急!如何更新表,从一个表中获得数据更新另一个表,在线等 在学生信息表(XSXXB)统计个班男生人数和女生人数,更新班级信息表(BJXXB)中各班的男生人数和女生人数谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 update BJXXBset 男生人数=(select sum(1) from XSXXB where 性别=男生), 女生人数=(select sum(1) from XSXXB where 性别=女生) update BJXXBset 男生人数=(select sum(1) from XSXXB where 性别='男生' and 班级=bjxxb.班级),女生人数=(select sum(1) from XSXXB where 性别='女生' and 班级=bjxxb.班级) update A set 男生人数=B.男生人数,女生人数=B.女生人数 from BJXXB A INNER JOIN (select 班级,sum(男生人数) 男生人数,sum(女生人数) 女生人数 from XSXXB group by 班级) B ON A.班级=B.班级 update BJXXB set 男生人数=(select sum(1) from XSXXB where 性别='男生' and 班级=bjxxb.班级), 女生人数=(select sum(1) from XSXXB where 性别='女生' and 班级=bjxxb.班级) 在线求一个SQL 一个SQL SERVER 2005权限的问题 sql 中的and or 问题 请大家帮忙这个SQL怎么写,急!!!! 表大了会慢吧? 動態列的實現? 请教SQL 不同表 两个联列之间相同部分 数据导入 SQL7的打包安装问题,很急,谢谢各位! 为什么总是出现这样的提示 这个触发器不支持同时更新 tblAccount多个记录时有效触发吗? 求一条SQL语句 请ai_li7758521、sql77、lingling1989r进来接分2
set 男生人数=(select sum(1) from XSXXB where 性别=男生),
女生人数=(select sum(1) from XSXXB where 性别=女生)
set 男生人数=(select sum(1) from XSXXB where 性别='男生' and 班级=bjxxb.班级),
女生人数=(select sum(1) from XSXXB where 性别='女生' and 班级=bjxxb.班级)
set 男生人数=(select sum(1) from XSXXB where 性别='男生' and 班级=bjxxb.班级),
女生人数=(select sum(1) from XSXXB where 性别='女生' and 班级=bjxxb.班级)