title: Group by with CASE in SELECT
body: <p>Hi I have a query like the following how do i group by ?</p>
  
  <pre><code> select distinct
   CTTA.TRANSACTION_TYPE "Transaction Type"
  , 'Quota1' "Quota Type"
  , CTTA.ATTRIBUTE2 "PO Number"
  , (CASE WHEN CTTA.TRANSACTION_TYPE='SFDC'
              THEN CTTA.ATTRIBUTE1
              ELSE CTTA.ATTRIBUTE39
      END
      ) "Customer"
  , CTTA.ATTRIBUTE75 "Opportunity Name"
  , CTTA.ATTRIBUTE63 "Comm Norm"
  , CTTA.ATTRIBUTE8 "Renewal"
  ,SUM(CTTA.TRANSACTION_AMT_FUNC_CURR) "Transaction Amount"
  from xxxxxx
  where xxxxxx
  GROUP BY 1,2,3,4,5,6,7
  </code></pre>