Hi I have a script below which groups the client together:
SQL
SELECTClient,COUNT(*)ASCosts,SUM(CASEWHENTrainclass='1'THEN1ELSE0END)ASFirstClass,SUM(CASEWHENTrainclass='2'THEN1ELSE0END)ASSecondClass,SUM(Seats)ASSeatsFROMdbo.PreviousMonthReportGROUPBYClient
This generates the below:
Text
Client Costs FirstC SecondC Seats Train1 4 13 14 81 AA_2 1 0 13 70 Train3 4 0 55 60 AA_4 1 18 37 41 Train2 1 33 99 44 BC_3 18 0 08 48 VR_1 1 11 61 25
However, is there a good way to add both the AA_2 and AA_4 together as one value so it would show the following:
Text
Client Costs FirstC SecondC Seats Train1 4 13 14 81 AA 2 18 50 111 Train3 4 0 55 60 Train2 1 33 99 44 BC_3 18 0 08 48 VR_1 1 11 61 25