title: WooCommerce-mysql - get list of products in a category
body: <p>I want to retrieve all products in side a subcategory . this is the code I've  :</p>
  
  <pre><code>SELECT * from `wp_term_relationships` where term_taxonomy_id=$subcatId and 
  object_id in(select ID from `wp_posts` where  `post_type`='product' and post_status='publish' and ID=wp_term_relationships.object_id) 
  </code></pre>
  
  <p>the problem is , this code return about 20 products but when I go to that category in website ,it returns about 40 products. </p>
  
  <p>could you help me ? I need a code to return a list of products inside a category . </p>