通过查询得到结果集内容如下:
id num
1 11
2 12
3 22
4 32
5 22
想要得到以下结果
id num
1 1
2 1
3 1
.....换句话就是想把num字段下的所有内容用指定的1来代替.请高手指点...
id num
1 11
2 12
3 22
4 32
5 22
想要得到以下结果
id num
1 1
2 1
3 1
.....换句话就是想把num字段下的所有内容用指定的1来代替.请高手指点...
update tt set num=1
select id, 1 as num from tt
就OK了
update tt set num=1
妈的太简单了三分贴啊
' from((((select studentid from record where gjid= '''+combobox3.Text +''' group by studentid) as k'+
' left join (select studentid,ksid from record where ksid like ''1%'' and gjid= '''+combobox3.Text +''' group by studentid ) as a on (k.studentid=a.studentid))'+
' left join(select studentid,ksid from record where ksid like ''2%'' and gjid= '''+combobox3.Text +''' group by studentid ) as b on (k.studentid=b.studentid))'+
' left join (select studentid,ksid from record where ksid like ''3%'' and gjid= '''+combobox3.Text +''' group by studentid) as c on (k.studentid=c.studentid))'; 这个是我的原码
现在想把临时表a ,b ,c 中的内容全部用1代替
select k.studentid as ''试卷号'',if(isnull(a.ksid),null,1) as ''Part A''