title: Nested queries in mysql which return primary key?
body: <p>Q. print the complete details of the product which is ordered by the maximum number of customers and its price is greater than 3.0</p>
  <p>products</p>
  <pre><code>+--------------+-------------+------+-----+---------+----------------+
  | Field        | Type        | Null | Key | Default | Extra          |
  +--------------+-------------+------+-----+---------+----------------+
  | productID    | int         | NO   | PRI | NULL    | auto_increment |
  | Name         | varchar(30) | NO   |     | NULL    |                |
  | Price        | double(3,2) | NO   |     | NULL    |                |
  | CoffeeOrigin | varchar(30) | YES  |     | NULL    |                |
  +--------------+-------------+------+-----+---------+----------------+
  </code></pre>
  <p>orders</p>
  <pre><code>+------------+----------+------+-----+---------+----------------+
  | Field      | Type     | Null | Key | Default | Extra          |
  +------------+----------+------+-----+---------+----------------+
  | orderID    | int      | NO   | PRI | NULL    | auto_increment |
  | productID  | int      | YES  | MUL | NULL    |                |
  | customerID | int      | YES  | MUL | NULL    |                |
  | Date_Time  | DateTime | NO   |     | NULL    |                |
  +------------+----------+------+-----+---------+----------------+
  </code></pre>
  <p>query:</p>
  <pre><code>select * from products where productID=y.id (
    select y.id from (
      select products.productsID as id, count(*) as counter 
      from orders join products on orders.productID=products.productID
      group by productID order by counter desc limit 1
    ) y
  );
  </code></pre>
  <p>what is that I m doing is not correct?</p>