是这样吗??
insert 表 select 物品,xl from 表单 union all select 物品,ml from 表单  union all select 物品,sl from 表单

解决方案 »

  1.   

    问题:   表单中如下
    ---------------------
     物品   xl    ml   sl    
    -----------------------
    01       1    3      5 其中xl ml sl 是服装的尺码,
    数据保存后在数据库表中如下
    -------------------
    物品   尺码
    --------------------
    01      1
    01      3
    01      5
    当数据插入时如何实现这样的转换???
      

  2.   

    insert 表 select 物品,xl from 表单 union all select 物品,ml from 表单  union all select 物品,sl from 表单可以吗????
      

  3.   

    insert 表 select * from (select 物品,xl tem from 表单 union all select 物品,ml tem from 表单  union all select 物品,sl tem from 表单) AA order by 物品
      

  4.   

    我先试试,谢谢你
    其实,我是用PB开发,
    ---------------------
     物品   xl    ml   sl    
    -----------------------
    01       1    3      5
    是在数据窗口中的,然后才在保存的时候
    在数据库里存为物品   尺码
    --------------------
    01      1
    01      3
    01      5
      

  5.   

    你的方法的话,如果都是SQL2000里,现在可以实现了先谢谢你
      

  6.   

    那你根据一条一条插入可以吗??insert 临时表 select 物品,xl from 表单 
    insert 临时表 select 物品,ml from 表单
    insert 临时表 select 物品,sl from 表单insert 表 select * from 临时表 order by 物品