title: MySQL using OR in Select Query - when class has been used
body: <p><strong>Info:</strong>  Server version: 5.1.39<br>
  <strong>Php:</strong>  5.4<br>
  MySQL / phpMyAdmin<br>
  <strong>Server:</strong>  Apache<br>
  <strong>Code is run via:</strong> Server SQL Query (copy &amp; paste in the phpMyAdmin) or in MySQL Workbench or using a custom shopping cart manager.<br>
  <strong>Exports to:</strong> Excel (.csv then to .xlsx for sales reports)<br>
  <strong>Other:</strong> I do use a number of tables for referencing  </p>
  
  <p>This is part of a larger <code>SELECT</code> Query I am running.  For the sake of brevity I have included only the section I currently need looking at.  </p>
  
  <pre><code>Select  
  T5.orders_id As OrdID,  
  T3.products_name As ProdName,  
  &lt;continues&gt;  
  (select value from /*PREFIX*/orders_total T5 where orders_id = T2.orders_id and class = 'ot_reward_points_discount') As ot_reward_points_discount,  
  (select value from /*PREFIX*/orders_total T5 where orders_id = T2.orders_id and class = 'ot_reward_points') As ot_reward_points_discount,  
  &lt;more data queries&gt;  
  Inner Join /*PREFIX*/orders T5 On (T5.orders_id = T2.orders_id)  
  &lt;number of joins and final WHERE/DESC&gt;
  </code></pre>
  
  <p>The results end up with me having 2 columns, the data has not merged.  I have been directed in to looking at an <code>OR</code> query so that the 2 will result in the one column.  There is no concern with results being overwritten as they 1st <code>select</code> &amp; the 2nd <code>select</code> are from different configs in my cart, 1 predates the other.  </p>
  
  <p>Because the <code>SELECT</code> chooses from a class value so it returns in column (not row) data per value I have NO idea how to create the <code>OR</code> query so it returns neatly.  </p>
  
  <p>Thank you for your help, please let me know if there is further info I need to supply.</p>