title: Using UNION to make 3 different outputs
body: <p>In my database, I am trying to find the highest price model for each maker. I want to make a query so my output lists the maker, the model and the price. As of now, I am able to get the output of the maker and the price, but I am unsure what to do in order to get my model to show up in the result.</p>
  
  <p>Here is my code and current output:</p>
  
  <pre><code>Select Product.Maker, Max(U.price)
  From (SELECT Price price, Model model
  From Desktop
  UNION ALL
  SELECT Price price, Model model
  From Laptop
  UNION ALL
  SELECT Price price, Model model
  From Printer) as U
  INNER JOIN Product
  ON Product.Model = U.model
  GROUP BY Product.Maker
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Maker Max(U.price) 
  A          899 
  B          1099 
  C          1399 
  D          1699 
  E          1599
  F          1799
  G          1899
  H          80
  I          259
  </code></pre>
  
  <p>I want this output to display the model number alongside the Maker and the Price such as:</p>
  
  <pre><code>Maker    Price    Model
  x        y        z
  </code></pre>
  
  <p>Here is the database schema, hope this helps! Any help would be greatly appreciated.</p>
  
  <pre><code>Computer Database schemas:
  
  Product( maker, model, type)
  Desktop( model, speed, ram, hd, price)
  Laptop( model, speed, ram, hd, screen,price)
  Printer( model, color, type, price)
  </code></pre>
  
  <p>I would be able to post the tables of all the information if that is helpful as well.</p>