How can i merge 3 sql select queries in single query? I am using this query 

SELECT 
  (SELECT tr.object_id, p.post_title, p.comment_count
   FROM wpug_term_relationships AS tr
   LEFT JOIN wpug_posts AS p ON p.post_parent = tr.object_id
   WHERE tr.term_taxonomy_id =122 
   ORDER BY tr.object_id DESC 
  ) AS Column1,  

  (SELECT tr.object_id, p.guid, p.post_type
  FROM wpug_term_relationships AS tr
  LEFT JOIN wpug_posts AS p ON p.post_parent = tr.object_id
  WHERE tr.term_taxonomy_id =122 AND p.post_type='attachment' 
  ORDER BY tr.object_id DESC 
  ) AS Column2, 

  (SELECT tr.object_id, p.meta_value, p.meta_key
   FROM wpug_term_relationships AS tr
   LEFT JOIN wpug_postmeta AS p ON p.post_id = tr.object_id
   WHERE tr.term_taxonomy_id =122 AND p.meta_key IN ('rehub_views', 'rehub_offer_product_price') 
   ORDER BY tr.object_id DESC 
  ) AS Column3
If you move part of the WHERE statements into the join you can accomplish the same thing:

SELECT tr.object_id, 
    p.post_title, p.comment_count,
    p2.guid, p2.post_type,
    pm.meta_value, pm.meta_key
FROM wpug_term_relationships AS tr
    LEFT JOIN wpug_posts AS p ON p.post_parent = tr.object_id
    LEFT JOIN wpug_posts AS p2 ON p2.post_parent = tr.object_id
        AND pm.post_type='attachment' 
    LEFT JOIN wpug_postmeta AS pm ON pm.post_id = tr.object_id 
        AND pm.meta_key IN ('rehub_views', 'rehub_offer_product_price') 
WHERE tr.term_taxonomy_id=122 
ORDER BY tr.object_id DESC


I noticed that on the first join to wpug_posts you don't filter post_type but on the second one you do.  I assume this means it will return multiple rows.  Do you want the first one to return post_type='attachment' as well?  If not you'll need to add AND p.post_type&lt;&gt;'attachment' to the first join