关于行变列的数据插入问题,难 是这样吗??insert 表 select 物品,xl from 表单 union all select 物品,ml from 表单 union all select 物品,sl from 表单 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 问题: 表单中如下--------------------- 物品 xl ml sl -----------------------01 1 3 5 其中xl ml sl 是服装的尺码,数据保存后在数据库表中如下-------------------物品 尺码--------------------01 101 301 5当数据插入时如何实现这样的转换??? insert 表 select 物品,xl from 表单 union all select 物品,ml from 表单 union all select 物品,sl from 表单可以吗???? insert 表 select * from (select 物品,xl tem from 表单 union all select 物品,ml tem from 表单 union all select 物品,sl tem from 表单) AA order by 物品 我先试试,谢谢你其实,我是用PB开发,--------------------- 物品 xl ml sl -----------------------01 1 3 5是在数据窗口中的,然后才在保存的时候在数据库里存为物品 尺码--------------------01 101 301 5 你的方法的话,如果都是SQL2000里,现在可以实现了先谢谢你 那你根据一条一条插入可以吗??insert 临时表 select 物品,xl from 表单 insert 临时表 select 物品,ml from 表单insert 临时表 select 物品,sl from 表单insert 表 select * from 临时表 order by 物品 俩表求和后结果填充到第三表 怎样找到某条数据的上一条和下一条数据(急,在线等!!) 排序的问题 表与表外连接,1:N的关系,如何只取外连接表的第一行 有关T-SQL分页,这条sql为什么错了。高手帮我分析,拜谢! 发奋斑竹,进来看一下,需要思路 请教一个sql的写法 如何让字段自动增长?请指教,谢谢 急!!要下岗了。mssql数据库msdb被置疑问题 头疼死了问题,毕业设计,急,急急,~! 怎么样用SQL来产生流水号 高手请进:SQL SERVER数据库连接和线程问题
---------------------
物品 xl ml sl
-----------------------
01 1 3 5 其中xl ml sl 是服装的尺码,
数据保存后在数据库表中如下
-------------------
物品 尺码
--------------------
01 1
01 3
01 5
当数据插入时如何实现这样的转换???
其实,我是用PB开发,
---------------------
物品 xl ml sl
-----------------------
01 1 3 5
是在数据窗口中的,然后才在保存的时候
在数据库里存为物品 尺码
--------------------
01 1
01 3
01 5
insert 临时表 select 物品,ml from 表单
insert 临时表 select 物品,sl from 表单insert 表 select * from 临时表 order by 物品