insert into hm (haoma)
select haoma from haoMaBiao

解决方案 »

  1.   

    如果hm表字段cishu不允许为空

    insert into hm (haoma,cishu)
    select haoma,0
    from haoMaBiao
      

  2.   

    insert into hm(haoma ) select haoma from haoMaBiao
      

  3.   

    create table haoMaBiao(haoma int)
    insert haoMaBiao select 123
    union all select 456
    union all select 789create table hm(haoma int, cishu varchar(20))insert hm select haoma, NULL from haoMaBiaoselect * from hm--result
    haoma       cishu                
    ----------- -------------------- 
    123         NULL
    456         NULL
    789         NULL(3 row(s) affected)
      

  4.   

    感谢coolingpipe(冷箫轻笛)、hlq8210(影子)、marco08(天道酬勤)的热心帮忙,谢谢了!