title: sum values per id for a specific condition without group by syntax
body: <p>I would like to sum the values that have the some id and 'Y'in YN column ,in a case statement, hence I can not use the group by syntax. Please see below an example and my code : Table T</p>
  
  <pre><code>ID   Value  YN
  1    4      Y
  1    6      Y
  2    3      N
  </code></pre>
  
  <p>Request:</p>
  
  <pre><code>select
  case when YN = 'Y'
       then ( select sum(Value) from T group by ID)
       else Value
  end as TotalResult;
  </code></pre>
  
  <p>Can you help me displaying only Totalresult ?  </p>