update m_my_special set m_videonum=b.rownum
from m_my_special as a inner join (select m_uid,m_specialid,count(1) as rownum from m_data group by m_uid,m_specialid) as b on a.m_uid=b.m_uid and b.m_specialid=a.m_id
select xxxx into #t--你自己写
from m_data a inner join m_my_special b on a.m_uid=b.m_uid and a.m_specialid=b.m_id
update m_my_special
set xxx=b.xxx
from m_my_special inner join #t b on m_my_special.主键=b.主键
格式就是上面的,下班了,你自己试试