请教update语句 高手进 update table1 set num1=(select count(*) from table2 where workid=table1.workid) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 1:update table1 set num1=(select count(*) from table2 where workid=table1.workid)2:update a set a.num1 = b.numfrom table1 ajoin (Select workid,count(*) as num from table2 group by workid) b on a.workid = b.workid update语句,上面高手已经说过了。我做过人事考勤软件,烦死了,哪会这么简单呀。比如,事假,往往不是一整天,而是以小时计的。所以,你的表1应该是记录事假起止时间,而不应该是一个一个的日期。尤其是请长假时,你的表结构就更显出问题了。表1是多余的。做成视图就行了。 如何通过日志文件恢复前天之前的数据 sql语句查询筛选怎么写? 复杂排序 没学过sql想请教个问题!我没有分了.但还是请前辈们解答.谢了! 存储过程varchar值溢出问题 能不能过sa口令获取Win2K的Administrator口令? 紧急求助,在线等待,问题解决,送分200 如何将padox数据库转为sql? 我想知道sql server的登陆id和密码在系统注册表里面有没有!具体位置! 高手请进。。。急急急 数据库服务器名字怎么更改? 创建表:简单,但是如果这样呢?
update table1 set num1=(select count(*) from table2 where workid=table1.workid)2:
update a set a.num1 = b.num
from table1 a
join (Select workid,count(*) as num from table2 group by workid) b
on a.workid = b.workid