select id, 1 as num from tt update tt set num=1 妈的太简单了三分贴啊
str :='select k.studentid as ''试卷号'',a.ksid as ''Part A'' ,b.ksid as ''Part B'',c.ksid as ''Part C'' '+ ' 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代替
呵呵,直接将a ,b ,c 中的内容用1不行?
经WWWWA 指点,问题得到完满解决 select k.studentid as ''试卷号'',if(isnull(a.ksid),null,1) as ''Part A''
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''