title: Microsoft SQL Server Management Studio - SELECT ALL from two INNER JOIN tables without duplicate columns
body: <p>I'm using Microsoft SQL Server Management Studio and have tried using GROUP BY and WHERE statements, I have also tried to use DISTINCT but am not sure if I am putting these in the wrong places or what. I've tried several different way, several different times with no luck. Either I get an error or I get duplicates.</p>
  
  <p><strong>Here's the problem:</strong></p>
  
  <pre><code>/*
  JOIN the Orders and OrderDetails tables to display all available fields
  about an order; however, only display the order number one time.
  Display an additional column labeled SubTotal that will multiply
  the quoted price by the quantity ordered.
  */
  </code></pre>
  
  <p><strong>Here's what I've got so far minus the non-working failed attempted bits:</strong></p>
  
  <pre><code>SELECT *,
         quotedPrice * quantityOrdered As [SubTotal]
  FROM Orders INNER JOIN OrderDetails ON Orders.orderNumber = OrderDetails.orderNumber
  </code></pre>
  
  <ul>
  <li>I tried to put GROUPBY orderNumber</li>
  <li>I tried to make another row in the select statement for DISTINCT orderNumber just above the row with the asterisk(all).</li>
  <li>I tried to use WHERE Orders.orderNumber = OrderDetails.orderNumber</li>
  </ul>
  
  <p>I've not been using SQL for very long, only about four months now. I'm still learning.</p>