title: How to select all productnames where the unit price is greater than average unit price?
body: <p>I want to write a SQL statement which selects all the productnames from a database where the unit price is greater than the average unit price. I am required to write a subquery.</p>
  
  <p>I tried it this way and I keep getting an error "from keyword not found where expected".</p>
  
  <pre><code>SELECT 
      PRODUCTID, Productname, unitprice
  FROM 
      Products 
  WHERE 
      unitprice IN (SELECT unitprice &gt; AVG(unitprice) FROM Products);
  </code></pre>
  
  <p>Then I added parenthesis and I keep getting another error, "missing right parenthesis":</p>
  
  <pre><code>SELECT 
      PRODUCTID, Productname, unitprice
  FROM 
      Products 
  WHERE 
      unitprice IN (SELECT (unitprice &gt;  AVG(unitprice)) FROM Products) ;
  </code></pre>