I've got a little query that will show us what our sales total was per market segment in a given period, but recently the decision was made to rename one of the segments from 'AUTO' to 'TRANS'.For the sake of clarity, I want to combine totals in segment 'AUTO' and 'TRANS' so that they appear under a single heading. This is the query:DECLARE @dtFromDate as DateTime, @dtToDate as DateTimeSET @dtFromDate = '2008-08-01 00:00:00.000'SET @dtToDate = '2008-08-31 23:59:59.999'SELECT SUM(aritem.ftotprice) AS TI, CASE somast.fusercode WHEN 'AUTO' THEN 'TRANS' ELSE somast.fusercode END as FUFROM aritem join armast on aritem.fcinvoice = armast.fcinvoice LEFT JOIN somast on LEFT(aritem.fsokey, 6) = somast.fsono WHERE finvdate BETWEEN @dtFromDate and @dtToDate AND aritem.fpartno NOT IN ('SHIPPING') AND aritem.fcinvoice NOT LIKE ('CM%') AND aritem.fcinvoice NOT LIKE ('PM%') AND aritem.fsokey NOT IN ('') AND armast.fcstatus NOT IN ('V') AND somast.fusercode IN ('ARCH', 'AUTO', 'INDS', 'PIPE', 'TRANS') GROUP BY somast.fusercodeORDER BY somast.fusercodeRight now it returns 123.45 ARCH123.45 TRANS123.45 INDS123.45 PIPE123.45 TRANS
where I'd prefer123.45 ARCH123.45 INDS123.45 PIPE246.90 TRANS
The sort order isn't so important, as I can do that after its bound to a DataGrid, I'm more looking for a way to combine the totals of seemingly unrelated data. How big of a problem is that going to be (I have tons more queries that need the same treatment).