title: Select statement with column based on another column values of same table
body: <p>I need select statement like</p>
  
  <pre><code>select Invoice, Original Color,Product,Option Color, Result_column from table
  </code></pre>
  
  <p>where Result_column value is based on below condition</p>
  
  <ol>
  <li>Available options are only 3 colors, RED, GREEN and BLUE.</li>
  <li>if all Option_Colors in invoice are green then result column will be
  GREEN.</li>
  <li><p>if all Option_Colors in invoice are blue then result column will be
  BLUE</p></li>
  <li><p>if all Option_Colors in invoice are red then result column will be
  RED</p></li>
  <li><p>In case of mixture of colors in Option_Colors of invoice, then
  whatever Color Original_Color column shows.</p>
  
  <ol start="6">
  <li>In case Option_Colors is not RED, GREEN or BLUE then whatever Color
  Original_Color column shows.</li>
  </ol></li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/mNeei.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mNeei.jpg" alt="result"></a></p>