title: Return value based on count in a case query
body: <p>i'm looking forward to your opinion about this request, it seems super simple but I can not figure it out alone.</p>
  <p>If the table column part_status has one value, return it; else return 'many'.</p>
  <p><strong>Scenario 1 Table data:</strong></p>
  <pre><code>Part_Status
  'A'
  'A'
  'A'
  </code></pre>
  <p>Returns</p>
  <pre><code>Part_Status
  'A'
  </code></pre>
  <p><strong>Scenario 2 Table data:</strong></p>
  <pre><code>Part_Status
  'A'
  </code></pre>
  <p>Return col1 value, here</p>
  <pre><code>Part_Status
  'A'
  </code></pre>
  <p><strong>Scenario 3 Table data:</strong></p>
  <pre><code>Part_Status
  'A'
  'E'
  </code></pre>
  <p>Return value</p>
  <pre><code>Part_Status
  'Many'
  </code></pre>
  <p>First idea was to use case and if the amount of count is greater 1 return 'many' but it is never printed:</p>
  <pre><code>select DISTINCT case
       when count(PART_STATUS) &gt; 1 THEN
        'MANY'
       ELSE
        PART_STATUS
     end
  from (select DISTINCT Part_Status
        from Inventory_Part
       where part_status IN ('A','E')
       )
  GROUP BY PART_STATUS
  </code></pre>
  <p>Returns</p>
  <pre><code>Part_Status
  'A'
  'E'
  </code></pre>
  <p>In the second idea I got 'Many' working but the single result is NULL</p>
  <pre><code>select CASE
       WHEN COUNT(PART_STATUS) &gt; 1 THEN
        'Many'
     end AS &quot;PART_STATUS&quot;
  FROM (select DISTINCT Part_Status
        from Inventory_Part
       where part_status IN ('A', 'E'))
  </code></pre>
  <p>Returns</p>
  <pre><code>Part_Status 
  'Many'
  </code></pre>
  <p>So, how to combine both?</p>