ID 快递单号 快递单价格 回单号 回单价格
1 001 10 1201 3
这类数据,怎么变成
id number price
1 001 10
1 1201 3
的格式
1 001 10 1201 3
这类数据,怎么变成
id number price
1 001 10
1 1201 3
的格式
解决方案 »
- vb+sql2000操作时提示不能更新 数据库为只读 ?
- 语句select ntid from tb_newstype where ntpid={0}中ntpid={0}中括号有什么作用
- 新手发问,感谢回答.
- 用php如何 获得mssql存储过程中return -1的“成功”或‘失败’信息
- 请高手进来指点下
- 跪求一个SQL语句
- 请问:如果一个查询的字段中含有单引号,该如何查询呢?请高手指教!谢谢!
- sql2000中用replace替换text类型的字段的值
- 自增(identity)属性的字段适合做有实际意义的记录的ID号吗?
- VISUAL FOXPRO是否有BUG?
- 怎么只统计唯一编号的行?
- 查找语句
select id,快递单号 as a,快递单价格 as b from tb
union all
select id,回单号,回单价格 from tb
order by id
union
select ID ,回单号, 回单价格 from T
union
select ID ,回单号, 回单价格 from tb
ID 快递单号 快递单价格 回单号 回单价格
1 001 10 1201 3
这类数据,怎么变成
id number price
1 001 10
1 1201 3
*/go
if OBJECT_ID('tbl') is not null
drop table tbl
go
create table tbl(
ID int,
快递单号 varchar(10),
快递单价格 numeric(10,2),
回单号 varchar(10),
回单价格 numeric(10,2)
)
insert tbl
select 1,'001',10,1201,3select id,快递单号 as number,快递单价格 as price from tbl
union all
select id,回单号,回单价格 from tbl/*
id number price
1 001 10.00
1 1201 3.00
*/