表a结构课程编号    教师姓名  教师学时    教师2姓名  教师2学时
计算机10   张三      10          李四       5想把表a  转换成 这种结构课程编号    姓名    学时  
计算机10   张三      10    
计算机10   李四       5 请前辈指点!

解决方案 »

  1.   

    select 课程编号,教师姓名,教师学时  from 表a
    union all
    select 课程编号,教师2姓名,教师2学时  from 表a
      

  2.   

    先感谢上面的指导,解决我燃煤之急!!问题又来了,怎样把面下这 变成一张新表,是不是用 select * into 表c ..........,再请指点!!select 课程编号,教师姓名,教师学时  from 表a
    union all
    select 课程编号,教师2姓名,教师2学时  from 表a
      

  3.   

    select * into 表c from(
    select 课程编号,教师姓名,教师学时  from 表a
    union all
    select 课程编号,教师2姓名,教师2学时  from 表a)a
      

  4.   


    select * from (select 课程编号,教师姓名,教师学时  from 表a union all select 课程编号,教师2姓名,教师2学时  from 表a) 表c   试了一下,这样行耶!!