代码
select ' ' as 全称,replace(v1.buyername,',',',') as 联系人,replace(v1.buyerphone,',',',') as 电话, ' ' as 省, ' ' as 市,' ' as 镇区,replace(v1.buyeraddress,',',',') as 地址, replace(v1.buyerzipcode,',',',') as 邮编,replace(v1.buyermobile,',',',') as 手机,(case when lower(replace(v1.depnameen,' ',' '))='japan' then replace(v1.depnameen,',',',') else ' ' end) as 国家,' ' as 目的站,' ' as 内件说明,' ' as 费用,' ' as 重量,' ' as 件数,' ' as 备注,' ' as 批打分组,' ' as 体积,' 'as 代收金额,' 'as 手续费,' ' as 保价金额,' ' as 保价费,' ' as 运费,' ' as 加急费, ' ' as 包装费, ' ' as 送货费,' ' as 其他费,' ' as 金额大写1,' ' as 自定义3,' ' as 自定义4,' ' as 自定义5 ,v1.SendNum into #t from v_Orders v1 where " + sqlwhere + @" order by v1.real_id desc,v1.id asc
select top 1000 ident = identity(int,1,1) into #t1 from syscolumns
select 全称, 联系人,电话,省,市,镇区,地址,邮编,手机, 国家,目的站,内件说明,费用,重量, 件数,备注,批打分组, 体积,代收金额,手续费,保价金额,保价费,运费,加急费,包装费, 送货费, 其他费,金额大写1, 自定义3,自定义4,自定义5
from #t ,#t1
where SendNum> =ident
drop table #t,#t1
select top 1000 ident = identity(int,1,1) into #t1 from syscolumns
select 全称, 联系人,电话,省,市,镇区,地址,邮编,手机, 国家,目的站,内件说明,费用,重量, 件数,备注,批打分组, 体积,代收金额,手续费,保价金额,保价费,运费,加急费,包装费, 送货费, 其他费,金额大写1, 自定义3,自定义4,自定义5
from #t ,#t1
where SendNum> =ident
drop table #t,#t1
string ds_sqlStrtu = @"select ' ' as 全称,replace(v1.buyername,',',',') as 联系人,replace(v1.buyerphone,',',',') as 电话, ' ' as 省, ' ' as 市,' ' as 镇区,replace(v1.buyeraddress,',',',') as 地址, replace(v1.buyerzipcode,',',',') as 邮编,replace(v1.buyermobile,',',',') as 手机,(case when lower(replace(v1.depnameen,' ',' '))='japan' then replace(v1.depnameen,',',',') else ' ' end) as 国家,' ' as 目的站,' ' as 内件说明,' ' as 费用,' ' as 重量,' ' as 件数,' ' as 备注,' ' as 批打分组,' ' as 体积,' 'as 代收金额,' 'as 手续费,' ' as 保价金额,' ' as 保价费,' ' as 运费,' ' as 加急费, ' ' as 包装费, ' ' as 送货费,' ' as 其他费,' ' as 金额大写1,' ' as 自定义3,' ' as 自定义4,' ' as 自定义5 ,v1.SendNum into #t from v_Orders v1 where " + sqlwhere + @" order by v1.real_id desc,v1.id asc
select top 1000 ident = identity(int,1,1) into #t1 from syscolumns
select 全称, 联系人,电话,省,市,镇区,地址,邮编,手机, 国家,目的站,内件说明,费用,重量, 件数,备注,批打分组, 体积,代收金额,手续费,保价金额,保价费,运费,加急费,包装费, 送货费, 其他费,金额大写1, 自定义3,自定义4,自定义5
from #t ,#t1
where SendNum> =ident
drop table #t,#t1 ";
ds2 = DB.getdataset(ds_sqlStrtu);
select top 1000 ident = identity(int,1,1) into #t1 from syscolumns
select 全称, 联系人,电话,省,市,镇区,地址,邮编,手机, 国家,目的站,内件说明,费用,重量, 件数,备注,批打分组, 体积,代收金额,手续费,保价金额,保价费,运费,加急费,包装费, 送货费, 其他费,金额大写1, 自定义3,自定义4,自定义5
from #t ,#t1
where SendNum> =ident
drop table #t,#t1 ";
ds2 = DB.getdataset(ds_sqlStrtu);