日期:2014-05-17 浏览次数:20595 次
create table 生产订单计划
(
客户编码 varchar(10),
铸件号 varchar(20),
进度1 int,
进度2 int,
进度3 int,
进度4 int
)
insert into 生产订单计划
select 'RFC010141' , '2402C-A', 20 , 30 , 31,33
union all select 'RFC010142' , '2802D-XX', 40 , 0 , 37 , 56
union all select 'RFC010154' , '3333Z-3E', 50 , 9 , 45 , 50
go
declare @sql nvarchar(4000)
set @sql = ''
select @sql = @sql + ',['+name+']'
from syscolumns
where id = OBJECT_ID('生产订单计划')
and name like '进度%'
order by colid
set @sql = 'select 铸件号,客户编码,进度,进度值
from&n