Hi guys,I am having a little diffulty displaying two columns next to each other in a case/group by statement as code shown below.I was wondering if i could have the results displayed such that the gst_amount and total_amount are in two separate columns (as they currently are) however the results of the rows are in the same row not in separate rows (as they are currently). I dont think i can do this in the current case statement that i have (i.e: the two case statements). Any feedback would be appreciatedSELECT distinct PERIOD.STARTDATE, temp_111.EVENTTYPEID, case when temp_111.[name] like '%GST%' then sum(temp_111.CONTRIBUTIONVALUE) end as GST_AMOUNT, case when temp_111.[name] not like '%GST%' then sum(temp_111.CONTRIBUTIONVALUE) end as Total_AmountFROM temp_111 INNER JOIN PERIOD ON temp_111.PERIODSEQ = PERIOD.PERIODSEQ WHERE (NOT temp_111.PRODUCTID = 'IIIE' OR temp_111.PRODUCTID IS NULL) AND temp_111.PERIODSEQ in ('111')group by PERIOD.STARTDATE, temp_111.EVENTTYPEID, temp_111.[name]Here is the current result displayed:Startdate eventtypeid gst_amount Total_amount2006-11-01 00:00:00.000 Nel NULL 83470.56080000002006-11-01 00:00:00.000 Nel NULL 161408.52648748102006-11-01 00:00:00.000 Nel NULL 677568.26830000002006-11-01 00:00:00.000 Nel NULL 2645478.12150924002006-11-01 00:00:00.000 Nel 8347.0560800000 NULL2006-11-01 00:00:00.000 Nel 16140.8526488160 NULL2006-11-01 00:00:00.000 Nel 67756.8268300000 NULL2006-11-01 00:00:00.000 Nel 264547.8121507070 NULL
Instead I want the result to show something like this:Startdate eventtypeid gst_amount Total_amount2006-11-01 00:00:00.000 Nel 8347.0560800000 83470.56080000002006-11-01 00:00:00.000 Nel 16140.8526488160 161408.52648748102006-11-01 00:00:00.000 Nel 67756.8268300000 677568.26830000002006-11-01 00:00:00.000 Nel 264547.8121507070 2645478.1215092400