Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Query help

$
0
0
Hi,
I need help in getting this type of output:

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')

Resultant output:
TransNo FirsvoucherNo  LastVoucherNo Quantity
trans1    V100     V104  5
trans1   V106      V106   1

Please Mark as Answer if my post works for you or Vote as Helpful if it helps you. Kapil Singh





Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>