我需要帮助才能获得这种类型的输出:
Create table T1
(Id int identity primary key,
VoucherNo varchar(10),
TransNo varchar(10)
)
Insert into T1 values ('V100','Trns1'),('V101','Trns1'),('V102','Trns1'),('V103','Trns1'),('V104','Trns1'),('V106','Trns1')
结果输出:
TransNo FirsvoucherNo LastVoucherNo Quantity
trans1 V100 V104 5
trans1 V106 V106 1