Quantcast
Channel: SQLServerCentral » SQL Server 2012 » SQL Server 2012 - T-SQL » Latest topics
Viewing all articles
Browse latest Browse all 4901

TSQL Subtotalling

$
0
0
Please forgive my ignorance if this is a simple fix but I am having a brain cramp. The goal: derive new records with subtotals of a recordset.Source recordset:index, workcode, value1, CL, 52, CL, 103, CL, 104, LI, 105, LI, 106, ME, 57, ME, 58, CL, 109, CL, 1010, CL, 511, ME, 1012, ME, 10Output:1, CL, 254, LI, 206, ME, 108, CL, 2511, ME, 20Notice that each break of the code is what triggers a new output record. Any assistance on TSQL code for accomplishing this would be greatly appreciated.Thanks in advance!

Viewing all articles
Browse latest Browse all 4901

Trending Articles