alter table 表 add id int identity(1,2)
go
update 表 set 编号=id
go
alter table 表 drop column id
go

解决方案 »

  1.   

    1。你把种子设成2应该就可以了吧
    2。select 学员编号 from 
    (select 学员编号,语文 as 分数 from tablename
    union all select 学员编号,数学 as 分数 from tablename
    union all select 学员编号,物理 as 分数 from tablename
    union all select 学员编号,化学 as 分数 from tablename
    ) as a group by a.学员编号 having sum(case when 分数>=60 then 0 else 1 end)=2
      

  2.   


    1、第一个为题是否可以考虑用触发器处理2、select 学员编号,case when 语文<60 then 1 else 0 end + 
                      case when 数学<60 then 1 else 0 end +
                      case when 物理<60 then 1 else 0 end +
                      case when 化学<60 then 1 else 0 end as '不及格科目'
    from table 
      

  3.   

    >这样!管的它有好多科目!!都可以select distinct 学员编号 
    from tbl
    where (select count(1) from tbl A where A.学员编号=tbl.学员编号 and 成绩<60 )>=2 
      

  4.   

    第一题vivianfdlpw() 就可以了
      

  5.   

    麻烦iwl()大侠,具体一点,这个问题很棘手,谢谢