title: SQL Nested Queries with Parent Parameters
body: <p>I need to write a query of the scenario but I am lost writing it.</p>
  
  <p>Assume there are two tables Items and Bids. The items are being selected via some sort of filter</p>
  
  <pre><code>SELECT i.* FROM Items i WHERE i.Id = 2
  </code></pre>
  
  <p>Now there is a Bids table having "ItemId" column to link Items to Bids. Now I want all items' data with HighestBid, LowestBid and TotalBids and I am trying this but it's not working.</p>
  
  <pre><code>SELECT i.*, hal.* 
  FROM Items i, (SELECT MAX(b.OfferAmount), MIN(b.OfferAmount), COUNT(b.*) FROM Bids b WHERE b.ItemId = i.Id) As hal
  WHERE i.Id = 2
  </code></pre>
  
  <p>Is there something wrong with this?</p>